[SG10] Feature test macros: always available, or in a header?

Richard Smith richard at metafoo.co.uk
Tue May 7 21:17:41 CEST 2013


Hi,

Has any thought been given to putting the feature-test macros into an
implementation-supplied header, instead of predefining them? This would
allow us to remove the cost associated with predefining these macros, for
translation units which don't need them. Instead, we could supply a single
predefined macro indicating whether the header is available, and user code
would write something like:

#ifdef __cpp_lib_header_features
#include <features>
#endif

#ifdef __cpp_relaxed_constexpr
constexpr
#endif
size_t strlen(const char *p) { /* ... */ }

... and so on.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.open-std.org/pipermail/features/attachments/20130507/c5abfc2a/attachment.html 


More information about the Features mailing list