Boost logo

Boost :

Subject: Re: [boost] enabling constexpr with Visual studio 2015 Update 3 (RC)
From: Gabriel Dos Reis (gdr_at_[hidden])
Date: 2016-06-19 22:10:45


_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:
> 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