Boost logo

Boost :

Subject: Re: [boost] C++17 detection
From: Glen Fernandes (glen.fernandes_at_[hidden])
Date: 2017-09-11 16:08:10

On Monday, September 11, 2017, Robert Ramey wrote:

> On 9/11/17 8:20 AM, Glen Fernandes via wrote:
>> Yes. You should add BOOST_NO_CXX17_STD_IS_DETECTED or similar to
> Boost.Config, just as we have added similar C++17 feature detection macros
>> recently (e.g
>> BOOST_NO_CXX17_FOLD_EXPRESSIONS, for Peter to use in Boost.Mp11).
> Hmmmm - this would require more thought. My actual interest is the usage
> o the "detection idiom". So there should be a
> BOOST_NO_CXX71_DECTECTION_IDIOM ? Actually that would be ideal for my
> case. But it would seem to me that that would be quite a narrow audience
> to justify the effort. I'm willing to assume that any library which claims
> C++17 conformance would support the detection idiom, but I don't find a
> macro on Boost.Config which lets me know which version of the C++ standard
> library is supported. It might be there but I haven't found it.
> I guess I'm looking for
> or something like that.

No, something like that sounds much less useful to me. Imagine if 90% of
implementations had a correct and working std::is_detected but all of those
had a broken or non-existent... say... std::launder, and so the macro you
suggest would be defined. You don't care that those implementations don't
have std::launder. You just care that they have std::is_detected.

BOOST_NO_CXX71_DECTECTION_IDIOM sounds reasonable and still granular enough.


Boost list run by bdawes at, gregod at, cpdaniel at, john at