C++ Logo

sg10

Advanced search

[SG10] N4266 Attributes for namespaces and enumerators

From: Nelson, Clark <clark.nelson_at_[hidden]>
Date: Mon, 23 Mar 2015 21:54:48 +0000
For this paper, Ed originally proposed:

__cpp_namespace_attributes 201411
__cpp_enumerator_attributes 201411

(i.e. new macros). And I countered with:

__cpp_has_attribute(deprecated) 201411

(i.e. an updated value).

My counterproposal has not (at least to date) been received warmly. And of
course my suggestion doesn't capture all the capabilities latent in the
paper, considering the possibility of implementation-specific attributes.

But it's not clear to me that implementation-specific attributes have
anything to do with the purposes of SG10 and SD-6. As far as portable code
is concerned, the only change implied by N4266 is that now [[deprecated]]
can appertain to namespaces and enumerators.

So the question boils down to this:

enum {
old
#if CONDITION
        [[deprecated]]
#endif
, new };

In code like that, how should the CONDITION read? The alternatives suggested
so far include:

__cpp_enumerator_attributes

and

__cpp_has_attribute(deprecated) >= 201400

Comments?

Clark

Received on 2015-03-23 22:54:58