Boost logo

Boost :

Subject: Re: [boost] Reminder: 1.65 closes for major changes tomorrow
From: Frédéric Bron (frederic.bron_at_[hidden])
Date: 2017-06-28 09:46:18


>> constexpr max() is C++11 - the context here is a template parameter if I
>> understand correctly. static_cast<>(-1) works on C++03.
>
> Do any of the macros
> BOOST_CONSTEXPR, BOOST_CONSTEXPR_OR_CONST, BOOST_STATIC_CONSTEXPR ...

I do not think these macros are useful here: we do not define a
function here. We need numeric_limits<UInteger>::max() value at
compile time as a template parameter and in C++03, ::max() is not
constexpr so that we have to use static_cast<UInteger>(-1) to have it
work on all c++ versions.

Frédéric


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