Boost logo

Boost :

Subject: Re: [boost] enabling constexpr with Visual studio 2015 Update 3 (RC)
From: Stephan T. Lavavej (stl_at_[hidden])
Date: 2016-06-20 12:38:58


Note that _HAS_CXX17 will be the STL's documented macro for detecting and controlling the library side of C++17 features. We determine its default value from _MSVC_LANG (for C1XX), but we permit it to be overridden in one direction. Namely, you can request C++17 compiler features, but only C++14 library features.

(At the moment, it is technically possible to request the opposite - C++14 compiler with C++17 library - but that will NOT be supported, as we may need to have new library features take dependencies on new compiler features.)

STL

-----Original Message-----
From: Boost [mailto:boost-bounces_at_[hidden]] On Behalf Of Gabriel Dos Reis
Sent: Sunday, June 19, 2016 7:11 PM
To: boost_at_[hidden]
Subject: Re: [boost] enabling constexpr with Visual studio 2015 Update 3 (RC)

_MSVC_LANG is the macro to hook on. Hopefully, there will be a published documentation of how to test for _MSC_VER and _MSVC_LANG. The actual value of _MSVC_LANG may change, but the landmark values to check against are those defined by the C++ standards for __cplusplus. So you would be testing

   _MSVC_LANG > 201402L

for post-C++14 features.

On Thu, Jun 16, 2016 at 3:16 AM, Paul A. Bristow <pbristow_at_[hidden]>
wrote:

> > -----Original Message-----
> > From: Boost [mailto:boost-bounces_at_[hidden]] On Behalf Of
> > Marcel
> Raad
> > Sent: 16 June 2016 07:50
> > To: boost_at_[hidden]
> > Subject: Re: [boost] enabling constexpr with Visual studio 2015
> > Update 3
> (RC)
> >
> > pabristow wrote
> > > But IMO *we really must know* which of std:c++14 and
> > > std::c++lastest
> (and
> > > others including c++11, c++17) are being specified for the
> > > compiler to use.
> > >
> > > The compiler version _MSC_FULL_VER = 190024123 does not tell you
> > > this - only that it is VS 2015 update 3.
> >
> > Seems like _MSVC_LANG is 201403 and _HAS_CXX17 is 1 with /std:c++latest.
> > _MSVC_LANG is 201402 and _HAS_CXX17 is 0 with /std:c++14. See yvals.h.
>
> Confirmed thanks.
>
> /std:c++latest
> Hello Boost!
> Platform: Win32
> Compiler: Microsoft Visual C++ version 14.0
> STL : Dinkumware standard library version 650
> Boost : 1.61.0
> _MSC_VER =1900
> _MSC_FULL_VER=190024123
> _MSVC_LANG=201403L
> __cplusplus=199711L
> _HAS_CXX17=1
> _HAS_AUTO_PTR_ETC=0
> Processor architecture = (x64)
>
> /std:c++14
> Hello Boost!
> Platform: Win32
> Compiler: Microsoft Visual C++ version 14.0
> STL : Dinkumware standard library version 650
> Boost : 1.61.0
> _MSC_VER =1900
> _MSC_FULL_VER=190024123
> _MSVC_LANG=201402L
> __cplusplus=199711L
> _HAS_CXX17=0
> _HAS_AUTO_PTR_ETC=1
> Processor architecture = (x64)
>
> but confusingly, _MSVC_LANG is not shown as defined using the IDE,
> but only gets defined and a value assigned when called by, for
> example, PRINT_MACRO in
>
> boost_1_61_0_b1\libs\config\test\config_info.cpp
>
> These macro MSVC_LANG and _HAS_CXX17 could usefully be added to
> config_info.cpp?
>
> This looks workable, if not uber convenient or clear. But things are
> getting better - slowly...
>
> Paul
>
> ---
> Paul A. Bristow
> Prizet Farmhouse
> Kendal UK LA8 8AB
> +44 (0) 1539 561830
>
>
>
>
>
>
>
>
> _______________________________________________
> Unsubscribe & other changes:
> https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2flists.
> boost.org%2fmailman%2flistinfo.cgi%2fboost&data=01%7c01%7cstl%40exchan
> ge.microsoft.com%7c7e0f5ee641384abd0e2608d398b953cd%7c72f988bf86f141af
> 91ab2d7cd011db47%7c1&sdata=cRtaCKPmQcyc6JTxCIfasuWAgMqQU%2bp1Ha82ZkNNh
> Ac%3d
>

_______________________________________________
Unsubscribe & other changes: https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2flists.boost.org%2fmailman%2flistinfo.cgi%2fboost&data=01%7c01%7cstl%40exchange.microsoft.com%7c7e0f5ee641384abd0e2608d398b953cd%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=cRtaCKPmQcyc6JTxCIfasuWAgMqQU%2bp1Ha82ZkNNhAc%3d


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