[SG10] __has_cpp_attribute example

Nelson, Clark clark.nelson at intel.com
Thu Oct 13 01:09:27 CEST 2016


> 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


More information about the Features mailing list