C++ Logo

sg10

Advanced search

Re: [SG10] Checking __has_include on its own is not sufficient

From: Jens Maurer <Jens.Maurer_at_[hidden]>
Date: Fri, 10 Feb 2017 00:25:19 +0100
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

Received on 2017-02-10 00:30:35