diff --git a/include/boost/variant2/variant.hpp b/include/boost/variant2/variant.hpp index 76ab756..0f64f42 100644 --- a/include/boost/variant2/variant.hpp +++ b/include/boost/variant2/variant.hpp @@ -538,7 +538,7 @@ template struct variant_base_impl { if( ix_ > 0 ) { - mp_for_index_c<1 + sizeof...(T)>( ix_, [&]( auto I ){ + mp_for_index<1 + sizeof...(T)>( ix_, [&]( auto I ){ using U = mp_at_c, I>; st1_.get( I ).~U(); @@ -635,7 +635,7 @@ template struct variant_base_impl { if( ix_ > 0 ) { - mp_for_index_c<1 + sizeof...(T)>( ix_, [&]( auto I ){ + mp_for_index<1 + sizeof...(T)>( ix_, [&]( auto I ){ using U = mp_at_c, I>; st1_.get( I ).~U(); @@ -644,7 +644,7 @@ template struct variant_base_impl } else if( ix_ < 0 ) { - mp_for_index_c<1 + sizeof...(T)>( -ix_, [&]( auto I ){ + mp_for_index<1 + sizeof...(T)>( -ix_, [&]( auto I ){ using U = mp_at_c, I>; st2_.get( I ).~U(); @@ -810,7 +810,7 @@ public: variant( variant const& r ) noexcept( mp_all...>::value ) { - mp_for_index_c( r.index(), [&]( auto I ){ + mp_for_index( r.index(), [&]( auto I ){ ::new( static_cast(this) ) variant_base( I, r._get_impl( I ) ); @@ -821,7 +821,7 @@ public: variant( variant && r ) noexcept( mp_all...>::value ) { - mp_for_index_c( r.index(), [&]( auto I ){ + mp_for_index( r.index(), [&]( auto I ){ ::new( static_cast(this) ) variant_base( I, std::move( r._get_impl( I ) ) ); @@ -865,7 +865,7 @@ public: variant& operator=( variant const & r ) noexcept( mp_all..., std::is_nothrow_copy_assignable...>::value ) { - mp_for_index_c( r.index(), [&]( auto I ){ + mp_for_index( r.index(), [&]( auto I ){ if( this->index() == I ) { @@ -885,7 +885,7 @@ public: variant& operator=( variant && r ) noexcept( mp_all..., std::is_nothrow_move_assignable...>::value ) { - mp_for_index_c( r.index(), [&]( auto I ){ + mp_for_index( r.index(), [&]( auto I ){ if( this->index() == I ) { @@ -966,7 +966,7 @@ public: { if( index() == r.index() ) { - mp_for_index_c( index(), [&]( auto I ){ + mp_for_index( index(), [&]( auto I ){ using std::swap; swap( get(*this), get(r) ); @@ -996,7 +996,7 @@ template constexpr bool operator==( variant const & v, variant { if( v.index() != w.index() ) return false; - return mp_for_index_c( v.index(), [&]( auto I ){ + return mp_for_index( v.index(), [&]( auto I ){ return get(v) == get(w); @@ -1007,7 +1007,7 @@ template constexpr bool operator!=( variant const & v, variant { if( v.index() != w.index() ) return true; - return mp_for_index_c( v.index(), [&]( auto I ){ + return mp_for_index( v.index(), [&]( auto I ){ return get(v) != get(w); @@ -1019,7 +1019,7 @@ template constexpr bool operator<( variant const & v, variant< if( v.index() < w.index() ) return true; if( v.index() > w.index() ) return false; - return mp_for_index_c( v.index(), [&]( auto I ){ + return mp_for_index( v.index(), [&]( auto I ){ return get(v) < get(w); @@ -1031,7 +1031,7 @@ template constexpr bool operator>( variant const & v, variant if( v.index() > w.index() ) return true; if( v.index() < w.index() ) return false; - return mp_for_index_c( v.index(), [&]( auto I ){ + return mp_for_index( v.index(), [&]( auto I ){ return get(v) > get(w); @@ -1043,7 +1043,7 @@ template constexpr bool operator<=( variant const & v, variant if( v.index() < w.index() ) return true; if( v.index() > w.index() ) return false; - return mp_for_index_c( v.index(), [&]( auto I ){ + return mp_for_index( v.index(), [&]( auto I ){ return get(v) <= get(w); @@ -1055,7 +1055,7 @@ template constexpr bool operator>=( variant const & v, variant if( v.index() > w.index() ) return true; if( v.index() < w.index() ) return false; - return mp_for_index_c( v.index(), [&]( auto I ){ + return mp_for_index( v.index(), [&]( auto I ){ return get(v) >= get(w);