Boost logo

Boost :

Subject: Re: [boost] C++17 detection
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2017-09-11 15:38:27


On 09/10/17 23:00, Joaquín M López Muñoz via Boost wrote:
>
>> Em 10 sept 2017, às 19:30, Robert Ramey via Boost <boost_at_[hidden]> escreveu:
>>
>> How do I get ready for C++17?
>>
>> I have a piece of code which requires C++14. I want to use something from C++17 but I also want my code to work now. So I have
>>
>> #if C++14 being used
>> namespace std {
>> // implement C++ function
>> } // std
>>
>> I've looked in the documentation for Boost.Config and can't find any hints there.
>
> You might find this technique useful:
>
> http://bannalia.blogspot.com/2016/09/compile-time-checking-existence-of.html?m=1
>
> The nice thing about it is you don't depend
> on implementation macros that might or
> might not be accurate.

This doesn't say if std::is_final is functional (i.e. not bugged). Also,
hijacking an unrelated class template for feature detection is kind of
hacky.

And I wonder how portable this is. std::is_final may actually be
std::some_internal_namespace::is_final; will it be found in this case?


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