Boost logo

Boost :

Subject: Re: [boost] [config] defining __has_extension in suffix.hpp?
From: John Maddock (boost.regex_at_[hidden])
Date: 2015-01-22 03:56:12


> It's useful to have
>
> #ifndef __has_feature
> #define __has_feature(x) 0
> #endif
>
> #ifndef __has_extension
> #define __has_extension __has_feature
> #endif
>
> in suffix.hpp so that one can then use __has_extension(foo) everywhere
> without fear. Otherwise, even
>
> #if defined(__clang__) && defined(__has_extension) && __has_extension(foo)
>
> is a preprocessor error when __has_extension is not defined (which it
> isn't when not on Clang.)

Good point.

However, aren't those reserved symbols? If we're being pedantic.... John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk