3.0.0
|
|
Freundlich's C++ toolkit |
A pair like std::pair
with both elements of the same type.
A homogenous pair of type T
is like an std::pair<T,T>
. A short example:
T | Can be any type |
Public Types | |
typedef T | value_type |
The value type. More... | |
typedef T | first_type |
typedef T | second_type |
Public Member Functions | |
homogenous_pair (value_type const &first, value_type const &second) | |
Initializes a pair. More... | |
homogenous_pair (value_type &&first, value_type &&second) | |
Initializes a pair by moving. More... | |
void | swap (homogenous_pair &other) |
Swaps two pairs. More... | |
Public Attributes | |
value_type | first |
The first element. More... | |
value_type | second |
The second element. More... | |
typedef T fcppt::homogenous_pair< T >::first_type |
typedef T fcppt::homogenous_pair< T >::second_type |
typedef T fcppt::homogenous_pair< T >::value_type |
The value type.
fcppt::homogenous_pair< T >::homogenous_pair | ( | value_type const & | first, |
value_type const & | second | ||
) |
Initializes a pair.
Initializes the pair with the values provided by first and second.
first | The value for the first member |
second | The value for the second member |
fcppt::homogenous_pair< T >::homogenous_pair | ( | value_type && | first, |
value_type && | second | ||
) |
Initializes a pair by moving.
void fcppt::homogenous_pair< T >::swap | ( | homogenous_pair< T > & | other | ) |
Swaps two pairs.
Swaps this pair with other. Swaps this->first
with other.first
and this->second
with other.second
.
other | The pair to swap with |
value_type fcppt::homogenous_pair< T >::first |
The first element.
value_type fcppt::homogenous_pair< T >::second |
The second element.