C++ Logo

SG10

Advanced search

Subject: Re: [SG10] Some small precedence for feature testing in C++
From: John Spicer (jhs_at_[hidden])
Date: 2013-08-01 05:59:16


There is also another difference between the SG10 recommendations and the __STDCPP... macros.

The __STDCPP... macros are used to determine implementation choices permitted under the standard.

The SG10 macros are used to detect the presence or absence, and in in some cases the version, of a feature required by the standard. They are primarily intended as a transition tool as support for features is added, but some can also be used for implementations that have a reason to turn off certain features in certain modes.

My recollection is that we deliberately stayed away from the __STDCPP prefix for these reasons and to avoid any implication that the features of the language could in any way be considered optional.

Which is not to say that we couldn't revisit the decision, but there was a discussion of this issue.

John.

On Jul 31, 2013, at 6:53 PM, "Nelson, Clark" <clark.nelson_at_[hidden]> wrote:

>> We have two similar feature-test macros already in the standard (16.8/2):
>>
>> __STDCPP_STRICT_POINTER_SAFETY__
>> __STDCPP_THREADS__
>>
>> I think the inconsistency between our recommendations and these is
>> unfortunate. Should we consider using names of that style instead of our
>> existing __cpp_* names? The above names are guaranteed to be defined to 1 if
>> the feature is available, so this wouldn't be an exact match for our
>> recommendations.
>
> There's another thing about our recommendations that doesn't match those:
> ours aren't technically standard; they're just (hopefully) going to be
> conventional.
>
> But maybe that's too finicky a distinction. For all we know, maybe someday
> consensus will support putting these conventions into the standard. We
> certainly aren't going to want to rename them at that point; maybe we should
> go with names that don't emphasize the difference.
>
> On the other hand, there's also __cplusplus -- lower case, no "std", no
> final underscores. We're following that example. :-)
>
> There's no such thing as perfect consistency.
>
> Clark
> _______________________________________________
> Features mailing list
> Features_at_[hidden]
> http://www.open-std.org/mailman/listinfo/features


SG10 list run by sg10-owner@lists.isocpp.org