Boost logo

Boost :

Subject: Re: [boost] C++17 detection
From: Robert Ramey (ramey_at_[hidden])
Date: 2017-09-11 14:56:15


On 9/10/17 1:00 PM, 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.

A little background

I've been using the "detection idiom" which has worked well for my
purposes. But this idiom is only found in C++17 libraries so I included
the code for it in my C++14 application. But now I want to include my
local version of the idiom itself only if there isn't one included in
with the library so I can't depend upon it.

So your solution looks promising.

All this makes me wonder if the usage of Boost.Config might be
diminished by using such techniques. Or perhaps, Boost.Config might be
broadened to make the usage of such techniques more accessible to the
"rest of us"

>
> Joaquín M López Muñoz
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


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