Boost logo

Boost :

Subject: Re: [boost] enabling constexpr with Visual studio 2015 Update 3 (RC)
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2016-06-13 09:54:30


> -----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)
>
> On Sat, Jun 11, 2016 at 11:57 AM, Glen Fernandes <glen.fernandes_at_[hidden]>
> wrote:
>
> > On Sat, Jun 11, 2016 at 11:41 AM, Paul A. Bristow wrote:
> > > Do I need to also add #define BOOST_CXX14_CONSTEXPR in my program or
> > elsewhere?
> > > (Doing this doesn't change BOOST_CONSTEXPR_OR_CONST from const to
> > constexpr)
> > >
> >
> > In develop, you have the option of defining BOOST_MSVC_CXX11_CONSTEXPR.
> >
>
> +1.
>
> 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.

I'm using a just-fully-updated modular-boost develop branch.

I've re-read

https://groups.google.com/forum/#!topic/boost-developers-archive/yzERahUyJRE

and added either or both

#define BOOST_CXX14_CONSTEXPR
#define BOOST_MSVC_CXX14_CONSTEXPR

but when I hover over

BOOST_CONSTEXPR_OR_CONST

it still shows const rather than constexpr

and I am not getting an (unsuccessful so far) attempt to implement constexpr

1>fixed_point_constexpr.cpp(61): error C2127: 'bn1': illegal initialization of 'constexpr' entity with a non-constant expression

that would be shown if I was misunderstanding the meaning of the hover display.

So I'm doing something wrong still.

(In case it helps, the code only contains

#include <boost/fixed_point/fixed_point.hpp>
#include <boost/math/special_functions/bernoulli.hpp>

    typedef boost::fixed_point::negatable<6u, -25, boost::fixed_point::round::nearest_even>
      small_fixed_point_type;

    constexpr small_fixed_point_type bn1 = boost::math::bernoulli_b2n<small_fixed_point_type>(1);

I'm hoping, perhaps over-optimistically, for a fixed-point value of ==0.1666667 to be assigned to bn1)

Paul

---
Paul A. Bristow
Prizet Farmhouse
Kendal UK LA8 8AB
+44 (0) 1539 561830

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