Skip to content

Commit 9a37e3b

Browse files
committed
Rename other to rhs
1 parent ec93054 commit 9a37e3b

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

include/nonstd/variant.hpp

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -834,18 +834,18 @@ class variant
834834
variant( T6 && t6 ) : type_index( 6 ) { new( ptr() ) T6( std::move( t6 ) ); }
835835
#endif
836836

837-
variant(variant const & other)
838-
: type_index( other.type_index )
837+
variant(variant const & rhs)
838+
: type_index( rhs.type_index )
839839
{
840-
(void) helper_type::copy( other.type_index, other.ptr(), ptr() );
840+
(void) helper_type::copy( rhs.type_index, rhs.ptr(), ptr() );
841841
}
842842

843843
#if variant_CPP11_OR_GREATER
844844

845-
variant( variant && other )
846-
: type_index( other.type_index )
845+
variant( variant && rhs )
846+
: type_index( rhs.type_index )
847847
{
848-
(void) helper_type::move( other.type_index, other.ptr(), ptr() );
848+
(void) helper_type::move( rhs.type_index, rhs.ptr(), ptr() );
849849
}
850850

851851
template< std::size_t I >
@@ -890,16 +890,16 @@ class variant
890890
helper_type::destroy( index(), ptr() );
891891
}
892892

893-
variant & operator=( variant const & other )
893+
variant & operator=( variant const & rhs )
894894
{
895-
return copy_assign( other );
895+
return copy_assign( rhs );
896896
}
897897

898898
#if variant_CPP11_OR_GREATER
899899

900-
variant & operator=( variant && other )
900+
variant & operator=( variant && rhs )
901901
{
902-
return move_assign( std::forward<variant>( other ) );
902+
return move_assign( std::forward<variant>( rhs ) );
903903
}
904904

905905
variant & operator=( T0 && t0 ) { return move_assign_value<T0,0>( std::forward<T0>( t0 ) ); }
@@ -964,21 +964,21 @@ class variant
964964

965965
#endif // variant_CPP11_OR_GREATER
966966

967-
void swap( variant & other ) variant_noexcept
967+
void swap( variant & rhs ) variant_noexcept
968968
{
969-
if ( valueless_by_exception() && other.valueless_by_exception() )
969+
if ( valueless_by_exception() && rhs.valueless_by_exception() )
970970
{
971971
// no effect
972972
}
973-
else if ( index() == other.index() )
973+
else if ( index() == rhs.index() )
974974
{
975-
this->swap_value( index(), other );
975+
this->swap_value( index(), rhs );
976976
}
977977
else
978978
{
979979
variant tmp( *this );
980-
*this = other;
981-
other = tmp;
980+
*this = rhs;
981+
rhs = tmp;
982982
}
983983
}
984984

@@ -1160,18 +1160,18 @@ class variant
11601160

11611161
#endif // variant_CPP11_OR_GREATER
11621162

1163-
void swap_value( std::size_t index, variant & other )
1163+
void swap_value( std::size_t index, variant & rhs )
11641164
{
11651165
using std::swap;
11661166
switch( index )
11671167
{
1168-
case 0: swap( this->template get<0>(), other.template get<0>() ); break;
1169-
case 1: swap( this->template get<1>(), other.template get<1>() ); break;
1170-
case 2: swap( this->template get<2>(), other.template get<2>() ); break;
1171-
case 3: swap( this->template get<3>(), other.template get<3>() ); break;
1172-
case 4: swap( this->template get<4>(), other.template get<4>() ); break;
1173-
case 5: swap( this->template get<5>(), other.template get<5>() ); break;
1174-
case 6: swap( this->template get<6>(), other.template get<6>() ); break;
1168+
case 0: swap( this->template get<0>(), rhs.template get<0>() ); break;
1169+
case 1: swap( this->template get<1>(), rhs.template get<1>() ); break;
1170+
case 2: swap( this->template get<2>(), rhs.template get<2>() ); break;
1171+
case 3: swap( this->template get<3>(), rhs.template get<3>() ); break;
1172+
case 4: swap( this->template get<4>(), rhs.template get<4>() ); break;
1173+
case 5: swap( this->template get<5>(), rhs.template get<5>() ); break;
1174+
case 6: swap( this->template get<6>(), rhs.template get<6>() ); break;
11751175
}
11761176
}
11771177

@@ -1289,7 +1289,7 @@ inline void swap(
12891289
// visit( Visitor&& vis, Variants&&... vars );
12901290

12911291
// The following visit is restricted with respect to the standard.
1292-
// It uses the common idiom is to return another variant:
1292+
// It uses the common idiom is to return anrhs variant:
12931293

12941294
template< class Visitor, class Variant >
12951295
inline Variant visit( Visitor const & vis, Variant const & v )

0 commit comments

Comments
 (0)