From 8499ae7e4ff0cf798367ebe6ea9fb991aa43db6c Mon Sep 17 00:00:00 2001 From: Ed Catmur Date: Fri, 24 Nov 2023 08:53:05 -0700 Subject: [PATCH 1/2] Use static const for next/prior from C++17 Trying to form next/prior in constant evaluation may be ill-formed; see https://github.com/boostorg/mpl/issues/69 --- include/boost/mpl/aux_/integral_wrapper.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/mpl/aux_/integral_wrapper.hpp b/include/boost/mpl/aux_/integral_wrapper.hpp index 8748fbb..661aa30 100644 --- a/include/boost/mpl/aux_/integral_wrapper.hpp +++ b/include/boost/mpl/aux_/integral_wrapper.hpp @@ -56,7 +56,8 @@ struct AUX_WRAPPER_NAME // have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC), // while some other don't like 'value + 1' (Borland), and some don't like // either -#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) +#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) \ + || __cplusplus >= 201703L private: BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1))); BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1))); From fb6b861834e29a93ba71a2e2501a42ecfd3c5655 Mon Sep 17 00:00:00 2001 From: Ed Catmur Date: Mon, 27 Nov 2023 09:55:00 -0600 Subject: [PATCH 2/2] Update integral_wrapper.hpp Apply change since C++11 --- include/boost/mpl/aux_/integral_wrapper.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/mpl/aux_/integral_wrapper.hpp b/include/boost/mpl/aux_/integral_wrapper.hpp index 661aa30..5f24b79 100644 --- a/include/boost/mpl/aux_/integral_wrapper.hpp +++ b/include/boost/mpl/aux_/integral_wrapper.hpp @@ -57,7 +57,7 @@ struct AUX_WRAPPER_NAME // while some other don't like 'value + 1' (Borland), and some don't like // either #if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) \ - || __cplusplus >= 201703L + || __cplusplus >= 201103L private: BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1))); BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));