Rename mp_for_index_c to mp_for_index

This commit is contained in:
Peter Dimov
2017-05-31 23:18:37 +03:00
parent 89e3588c9b
commit f74da6d382

View File

@@ -538,7 +538,7 @@ template<class... T> struct variant_base_impl<false, true, T...>
{
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<mp_list<none, T...>, I>;
st1_.get( I ).~U();
@@ -635,7 +635,7 @@ template<class... T> struct variant_base_impl<false, false, T...>
{
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<mp_list<none, T...>, I>;
st1_.get( I ).~U();
@@ -644,7 +644,7 @@ template<class... T> struct variant_base_impl<false, false, T...>
}
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<mp_list<none, T...>, I>;
st2_.get( I ).~U();
@@ -810,7 +810,7 @@ public:
variant( variant const& r )
noexcept( mp_all<std::is_nothrow_copy_constructible<T>...>::value )
{
mp_for_index_c<sizeof...(T)>( r.index(), [&]( auto I ){
mp_for_index<sizeof...(T)>( r.index(), [&]( auto I ){
::new( static_cast<variant_base*>(this) ) variant_base( I, r._get_impl( I ) );
@@ -821,7 +821,7 @@ public:
variant( variant && r )
noexcept( mp_all<std::is_nothrow_move_constructible<T>...>::value )
{
mp_for_index_c<sizeof...(T)>( r.index(), [&]( auto I ){
mp_for_index<sizeof...(T)>( r.index(), [&]( auto I ){
::new( static_cast<variant_base*>(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_constructible<T>..., std::is_nothrow_copy_assignable<T>...>::value )
{
mp_for_index_c<sizeof...(T)>( r.index(), [&]( auto I ){
mp_for_index<sizeof...(T)>( r.index(), [&]( auto I ){
if( this->index() == I )
{
@@ -885,7 +885,7 @@ public:
variant& operator=( variant && r )
noexcept( mp_all<std::is_nothrow_move_constructible<T>..., std::is_nothrow_move_assignable<T>...>::value )
{
mp_for_index_c<sizeof...(T)>( r.index(), [&]( auto I ){
mp_for_index<sizeof...(T)>( r.index(), [&]( auto I ){
if( this->index() == I )
{
@@ -966,7 +966,7 @@ public:
{
if( index() == r.index() )
{
mp_for_index_c<sizeof...(T)>( index(), [&]( auto I ){
mp_for_index<sizeof...(T)>( index(), [&]( auto I ){
using std::swap;
swap( get<I>(*this), get<I>(r) );
@@ -996,7 +996,7 @@ template<class... T> constexpr bool operator==( variant<T...> const & v, variant
{
if( v.index() != w.index() ) return false;
return mp_for_index_c<sizeof...(T)>( v.index(), [&]( auto I ){
return mp_for_index<sizeof...(T)>( v.index(), [&]( auto I ){
return get<I>(v) == get<I>(w);
@@ -1007,7 +1007,7 @@ template<class... T> constexpr bool operator!=( variant<T...> const & v, variant
{
if( v.index() != w.index() ) return true;
return mp_for_index_c<sizeof...(T)>( v.index(), [&]( auto I ){
return mp_for_index<sizeof...(T)>( v.index(), [&]( auto I ){
return get<I>(v) != get<I>(w);
@@ -1019,7 +1019,7 @@ template<class... T> constexpr bool operator<( variant<T...> const & v, variant<
if( v.index() < w.index() ) return true;
if( v.index() > w.index() ) return false;
return mp_for_index_c<sizeof...(T)>( v.index(), [&]( auto I ){
return mp_for_index<sizeof...(T)>( v.index(), [&]( auto I ){
return get<I>(v) < get<I>(w);
@@ -1031,7 +1031,7 @@ template<class... T> constexpr bool operator>( variant<T...> const & v, variant
if( v.index() > w.index() ) return true;
if( v.index() < w.index() ) return false;
return mp_for_index_c<sizeof...(T)>( v.index(), [&]( auto I ){
return mp_for_index<sizeof...(T)>( v.index(), [&]( auto I ){
return get<I>(v) > get<I>(w);
@@ -1043,7 +1043,7 @@ template<class... T> constexpr bool operator<=( variant<T...> const & v, variant
if( v.index() < w.index() ) return true;
if( v.index() > w.index() ) return false;
return mp_for_index_c<sizeof...(T)>( v.index(), [&]( auto I ){
return mp_for_index<sizeof...(T)>( v.index(), [&]( auto I ){
return get<I>(v) <= get<I>(w);
@@ -1055,7 +1055,7 @@ template<class... T> constexpr bool operator>=( variant<T...> const & v, variant
if( v.index() > w.index() ) return true;
if( v.index() < w.index() ) return false;
return mp_for_index_c<sizeof...(T)>( v.index(), [&]( auto I ){
return mp_for_index<sizeof...(T)>( v.index(), [&]( auto I ){
return get<I>(v) >= get<I>(w);