[SG10] __has_cpp_attribute example

2016-10-12 Thread Jonathan Wakely
The SD-6 draft has [3.3.6] Example This demonstrates a way to use the attribute [[deprecated]] only if it is available. #ifdef __has_cpp_attribute # if __has_cpp_attribute(deprecated) #define ATTR_DEPRECATED(msg) [[deprecated(msg)]] # else #define ATTR_DEPRECATED(msg) # endif #endif

Re: [SG10] __has_cpp_attribute example

2016-10-12 Thread Aaron Ballman
On Wed, Oct 12, 2016 at 6:55 AM, Jonathan Wakely wrote: > The SD-6 draft has > > [3.3.6] Example > > This demonstrates a way to use the attribute [[deprecated]] only if it > is available. > > #ifdef __has_cpp_attribute > # if __has_cpp_attribute(deprecated) > #define ATTR_DEPRECATED(msg) [[de

Re: [SG10] __has_cpp_attribute example

2016-10-12 Thread Jonathan Wakely
On 12 October 2016 at 12:51, Aaron Ballman wrote: > On Wed, Oct 12, 2016 at 6:55 AM, Jonathan Wakely wrote: >> The SD-6 draft has >> >> [3.3.6] Example >> >> This demonstrates a way to use the attribute [[deprecated]] only if it >> is available. >> >> #ifdef __has_cpp_attribute >> # if __has_cpp

[SG10] std::sample missing from SD-6

2016-10-12 Thread Jonathan Wakely
P0220R1 added std::sample from Library Fundamentals v1 to the WP, but this isn't mentioned in SD-6. I suggest adding __cpp_lib_sample to the P0220R1 section of the C++17 table. [5.15.106] says that sample was omitted from P0220R1, but it wasn't (see 12.3 in the proposal, and note that we only too

Re: [SG10] __has_cpp_attribute example

2016-10-12 Thread Nelson, Clark
> This leaves ATTR_DEPRECATED undefined if the compiler doesn't > support > the __has_cpp_attribute macro, is that intended? Unless the idea is > that some other method would be used to decide if it's available, it > should be something like: > > #ifdef __has_cpp_attribute > # if __has_cpp_attrib

Re: [SG10] __has_cpp_attribute example

2016-10-12 Thread Richard Smith
On Wed, Oct 12, 2016 at 3:55 AM, Jonathan Wakely wrote: > The SD-6 draft has > > [3.3.6] Example > > This demonstrates a way to use the attribute [[deprecated]] only if it > is available. > > #ifdef __has_cpp_attribute > # if __has_cpp_attribute(deprecated) > #define ATTR_DEPRECATED(msg) [[d

Re: [SG10] __has_cpp_attribute example

2016-10-12 Thread Nelson, Clark
> The usage model we've always documented for these __has_* macros in > Clang is: > > #ifndef __has_cpp_attribute > # define __has_cpp_attribute(x) 0 > #endif > > #if __has_cpp_attribute(deprecated) > # define ATTR_DEPRECATED(msg) [[deprecated(msg)]] > #else > > # define ATTR_DEPRECATED(msg) >