[SG10] Checking __has_include on its own is not sufficient

Jens Maurer Jens.Maurer at gmx.net
Fri Feb 10 00:25:19 CET 2017


On 02/09/2017 11:59 PM, Jonathan Wakely wrote:
> It's become apparent that the feature-test recommendations for
> features such as std::string_view, std::variant and std::optional are
> not sufficient.
> 
> SD-6 says that to check for std::variant you should use
> __has_include(<variant>).

My gut reaction to this issue is
"can't we make __has_include return false if #including
the header doesn't actually provide the facility"?

(I would also be happy if "#include <variant>" would simply
be an error in older modes, although I do agree the gcc
error message is helpful.)

Jens


More information about the Features mailing list