C++ Logo

sg10

Advanced search

Re: [SG10] __has_cpp_attribute example

From: Nelson, Clark <clark.nelson_at_[hidden]>
Date: Wed, 12 Oct 2016 23:09:27 +0000
> 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)
>
> #endif

Does anyone have a better bid than this one?

Clark

Received on 2016-10-13 01:09:32