template<class L, class R>
Rodin::Pair class

A Pair class representing a tuple with two elements.

Template parameters
L Type of the first element.
R Type of the second element.

The Pair class extends the Tuple class for exactly two elements, providing convenient accessors for the first and second elements.

Public types

using Parent = Tuple<L, R>
Parent class type.

Constructors, destructors, conversion operators

Pair(const Pair& other)
Copy constructor.
Pair(Pair&& other)
Move constructor.

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

template<class L, class R>
Rodin::Pair<L, R>::Pair(const Pair& other)

Copy constructor.

Parameters
other The Pair object to copy from.

template<class L, class R>
Rodin::Pair<L, R>::Pair(Pair&& other)

Move constructor.

Parameters
other The Pair object to move from.

template<class L, class R>
Pair& Rodin::Pair<L, R>::operator=(const Pair& other) constexpr

Copy assignment operator.

Parameters
other The Pair object to copy from.
Returns Reference to this Pair.

template<class L, class R>
Pair& Rodin::Pair<L, R>::operator=(Pair&& other) constexpr

Move assignment operator.

Parameters
other The Pair object to move from.
Returns Reference to this Pair.

template<class L, class R>
auto& Rodin::Pair<L, R>::first()

Retrieves the first element of the Pair.

Returns Reference to the first element.

template<class L, class R>
auto& Rodin::Pair<L, R>::second()

Retrieves the second element of the Pair.

Returns Reference to the second element.

template<class L, class R>
const auto& Rodin::Pair<L, R>::first() const

Retrieves the first element of the Pair (const version).

Returns Const reference to the first element.

template<class L, class R>
const auto& Rodin::Pair<L, R>::second() const

Retrieves the second element of the Pair (const version).

Returns Const reference to the second element.