...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
The TR1 Tuple provides the standard boolean relational operators.
Notation
T1
... TN
,
U1 ...
UN
Tuple element types
P1
... PN
Parameter types
Ti
,
Ui
The type of the i
th
element of a tuple
Pi
The type of the i
th
parameter
template<typename T1, typename T2, ..., typename TN, typename U1, typename U2, ..., typename UN> bool operator==( const tuple<T1, T2, ..., TN>& lhs, const tuple<U1, U2, ..., UN>& rhs);
Requirements: For all i
,
1 <=
i <
N
,
is a valid expression returning a type that is convertible to get
<i>(lhs) == get
<i>(rhs)bool
.
Semantics: Returns true
if and only if
for all get
<i>(lhs) == get
<i>(rhs)i
. For any 2 zero
length tuples e
and f
, e
== f
returns true
.
template<typename T1, typename T2, ..., typename TN, typename U1, typename U2, ..., typename UN> bool operator<( const tuple<T1, T2, ..., TN>& lhs, const tuple<U1, U2, ..., UN>& rhs);
Requirements: For all i
,
1 <=
i <
N
,
is a valid expression returning a type that is convertible to get
<i>(lhs) < get
<i>(rhs)bool
.
Semantics: Returns the lexicographical
comparison of between lhs
and rhs
.
template<typename T1, typename T2, ..., typename TN, typename U1, typename U2, ..., typename UN> bool operator!=( const tuple<T1, T2, ..., TN>& lhs, const tuple<U1, U2, ..., UN>& rhs);
Requirements: For all i
,
1 <=
i <
N
,
is a valid expression returning a type that is convertible to get
<i>(lhs) == get
<i>(rhs)bool
.
Semantics: Returns !(lhs == rhs)
.
template<typename T1, typename T2, ..., typename TN, typename U1, typename U2, ..., typename UN> bool operator<=( const tuple<T1, T2, ..., TN>& lhs, const tuple<U1, U2, ..., UN>& rhs);
Requirements: For all i
,
1 <=
i <
N
,
is a valid expression returning a type that is convertible to get
<i>(rhs) < get
<i>(lhs)bool
.
Semantics: Returns !(rhs < lhs)
template<typename T1, typename T2, ..., typename TN, typename U1, typename U2, ..., typename UN> bool operator>( const tuple<T1, T2, ..., TN>& lhs, const tuple<U1, U2, ..., UN>& rhs);
Requirements: For all i
,
1 <=
i <
N
,
is a valid expression returning a type that is convertible to get
<i>(rhs) < get
<i>(lhs)bool
.
Semantics: Returns rhs
< lhs
.
template<typename T1, typename T2, ..., typename TN, typename U1, typename U2, ..., typename UN> bool operator>=( const tuple<T1, T2, ..., TN>& lhs, const tuple<U1, U2, ..., UN>& rhs);
Requirements: For all i
,
1 <=
i <
N
,
is a valid expression returning a type that is convertible to get
<i>(lhs) < get
<i>(rhs)bool
.
Semantics: Returns !(lhs < rhs)
.