> That is C++14 constexpr; C1XX only supports C++11 constexpr.
I think it may even be a C++17 feature and I have tried /std:c++14 and /std:c++latest to try to enable this.
http://en.cppreference.com/w/cpp/language/constexpr says
the function body must be either deleted or defaulted
* or contain any statements except:*
an asm declaration. Not this
a goto statement. No goto.
a statement with a label other than case and default. NO labels.
a try-block . No trying.
a definition of a variable of non-literal type. Is literal (int, float ...)
a definition of a variable of static or thread storage duration. No static.
a definition of a variable for which no initialization is performed. (variable IS initialized)
But maybe the language lawyers can advise if I am mistaken.
either way, it's a showstopper for taking existing code and making constexpr functions.
But there are more hurdles:
template<typename FloatingPointType>
...
BOOST_CONSTEXPR_OR_CONST bool is_neg = (f < FloatingPointType(0));
and
// Extract the mantissa and exponent.
int exp2 = 0; // Initialize to make constexpr possible.
BOOST_CONSTEXPR_OR_CONST FloatingPointType fp(frexp((!is_neg) ? f : -f, &exp2));
both fail to compile on VS 2015 update 3 RC and GCC 5.8.0.
So there are hoops that look out of reach for now.
Paul
> On Thu, Jun 23, 2016 at 7:23 AM -0700, "Paul A. Bristow" <
pbri...@hetp.u-net.com<mailto:
pbri...@hetp.u-net.com>>
> wrote:
>
> > -----Original Message-----
> > From: Boost [mailto:
boost-...@lists.boost.org] On Behalf Of Beman Dawes
> > Sent: 11 June 2016 17:06
> > To: Boost Developers List
> > Subject: Re: [boost] enabling constexpr with Visual studio 2015 Update 3 (RC)
> >
> > You might want to read the thread "[config] Changes needed for VC++ 2015
> > Update 3?" if you have not already done so.
> >
> > Please file a MSVC bug report if you hit any C++11 constexpr bugs in the
> > Update 3 RC. They giving very high priority to C++11 bugs affecting Boost
> > code. They would like us to be able to turn BOOST_NO_CXX11_CONSTEXPR off
> > for Update 3.
>
> Unless I am doing something very silly using VS 2015 Update 3 RC,