From 3c9f4e56bf9266de3b3872952f3b28ae03b8342f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 24 Jan 2021 17:27:24 +0200 Subject: [PATCH] Fix visit codegen regression when NDEBUG is not defined --- include/boost/variant2/variant.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/variant2/variant.hpp b/include/boost/variant2/variant.hpp index 2409c54..f46fdb4 100644 --- a/include/boost/variant2/variant.hpp +++ b/include/boost/variant2/variant.hpp @@ -834,7 +834,7 @@ template struct variant_base_impl constexpr std::size_t index() const noexcept { - return static_cast( ix_ ) - 1; + return ix_ - 1; } template BOOST_CXX14_CONSTEXPR mp11::mp_at_c, I>& _get_impl( mp11::mp_size_t ) noexcept @@ -904,7 +904,7 @@ template struct variant_base_impl constexpr std::size_t index() const noexcept { - return static_cast( ix_ ) / 2 - 1; + return ix_ / 2 - 1; } template BOOST_CXX14_CONSTEXPR mp11::mp_at_c, I>& _get_impl( mp11::mp_size_t ) noexcept @@ -990,7 +990,7 @@ template struct variant_base_impl constexpr std::size_t index() const noexcept { - return static_cast( ix_ ) - 1; + return ix_ - 1; } template BOOST_CXX14_CONSTEXPR mp11::mp_at_c, I>& _get_impl( mp11::mp_size_t ) noexcept @@ -1116,7 +1116,7 @@ template struct variant_base_impl constexpr std::size_t index() const noexcept { - return static_cast( ix_ ) / 2 - 1; + return ix_ / 2 - 1; } template BOOST_CXX14_CONSTEXPR mp11::mp_at_c, I>& _get_impl( mp11::mp_size_t ) noexcept