Boost logo

Boost :

Subject: Re: [boost] enabling constexpr with Visual studio 2015 Update 3 (RC)
From: Billy O'Neal (VC LIBS) (bion_at_[hidden])
Date: 2016-06-23 10:28:45

That is C++14 constexpr; C1XX only supports C++11 constexpr.

Sent from a touchscreen; please excuse the brevity.

On Thu, Jun 23, 2016 at 7:23 AM -0700, "Paul A. Bristow" <pbristow_at_[hidden]<mailto:pbristow_at_[hidden]>> wrote:

> -----Original Message-----
> From: Boost [mailto:boost-bounces_at_[hidden]] 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 Update 3 RC,
it is not possible to declare and initialization any constexpr intermediate variables within a constexpr function.

constexpr int tripled(int n)
  constexpr int f = 3; // C3250: 'f': declaration is not allowed in 'constexpr' function body
  // constexpr_variable_in_function.cpp(35) : error C3249 : illegal statement or sub - expression for 'constexpr' function

  return n * f;
even using /std:c++latest

Reported as

My reading of C++17 draft is that is now an added feature, and this work with GCC 5.3.0 (not even the most recent version).

Lack of this is a showstopper when trying to define any (mathy) function where it is impossible/impractical to provide a single
return statement.


Paul A. Bristow
Prizet Farmhouse
Kendal UK LA8 8AB
+44 (0) 1539 561830
Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at