Boost logo

Boost :

Subject: Re: [boost] [config] Using SD-6 macros
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2015-06-13 05:22:55


On 13.06.2015 05:26, Edward Diener wrote:
> On 6/12/2015 1:05 PM, Peter Dimov wrote:
>>
>> All __cpp_lib macros have an associated header, although I don't know if
>> we currently have Boost.Config equivalents for any of them.
>
> I can see them but they are all C++14 features. Are we really objecting
> to including a particular standard library header in order to test for
> the existence of the equivalent SD-6 macro ?

Yes, that would be the objection from my side, at least. I don't want to
include a whole std header to check for a single feature that may be
implemented in it. And I want Boost.Config to include most of STL even less.

>> It seems to me that there's no macro for SD-6 itself though. When
>> __cpp_something is not defined, you don't know whether this is because
>> 'something' is not implemented or because SD-6 is not implemented.
>
> What difference could it possibly make ? You test if a macro is defined
> and if it is not you try something else. If it is you have your answer.

For a compiler that does not support SD-6 you would end up with "the
compiler does not support C++" with this approach. :) Seriously, you do
have to know when to check those macros, if you want to know the actual
capabilities of the compiler.

I can see SD-6 only as a helper tool for libraries like Boost.Config and
not as an alternative. We had various version and feature checks in
Boost.Config for years, it worked wonderfully and I don't see why it
would break for the existing compilers we support. Future compilers may
add features that are currently missing, and we will have to update
Boost.Config accordingly, whether the compilers use SD-6, misuse it or
not use it at all.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk