Skip to content

Commit

Permalink
Use static const for next/prior from C++17
Browse files Browse the repository at this point in the history
Trying to form next/prior in constant evaluation may be ill-formed; see boostorg#69
  • Loading branch information
ecatmur authored and jeking3 committed Jan 3, 2025
1 parent d95bae3 commit 157204a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/boost/mpl/aux_/integral_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down

0 comments on commit 157204a

Please sign in to comment.