Pair
Forward declaration of the Pair template class.
Defined in Rodin/Pair.h
template < class L, class R> class Pair;
| Template parameters | |
|---|---|
| L | Type of the first element. |
| R | Type of the second element. |
A Pair class representing a tuple with two elements.
The Pair class extends the Tuple class for exactly two elements, providing convenient accessors for the first and second elements.
Inherits from
| Base class | Responsibility |
|---|---|
Tuple<L, R>publicFull typeTuple< L, R > | Forward declaration of the Tuple template class. |
Public types
Constructors, destructors, conversion operators
Public functions
- auto operator=(const Pair& other) -> Pair& constexpr
- Copy assignment operator.
- auto operator=(Pair&& other) -> Pair& constexpr
- Move assignment operator.
- auto first() -> auto&
- Retrieves the first element of the Pair.
- auto second() -> auto&
- Retrieves the second element of the Pair.
- auto first() const -> const auto&
- Retrieves the first element of the Pair (const version).
- auto second() const -> const auto&
- Retrieves the second element of the Pair (const version).
Function documentation
const auto& first() const
Retrieves the first element of the Pair (const version).
| Returns | Const reference to the first element. |
|---|
const auto& second() const
Retrieves the second element of the Pair (const version).
| Returns | Const reference to the second element. |
|---|