|
| | Pair ()=default |
| | Default constructor.
|
| | Pair (const Pair &other)=default |
| | Copy constructor.
|
| | Pair (const T1 &first, const T2 &second) |
| | Constructor with initial values.
|
| | Pair (Pair &&other) noexcept |
| | Move constructor.
|
| Pair & | operator= (const Pair &other)=default |
| | Copy assignment operator.
|
| Pair & | operator= (Pair &&other) noexcept |
| | Move assignment operator.
|
| void | swap (Pair &other) noexcept |
| | Swaps the contents of this Pair with another Pair.
|
template<typename T1, typename T2>
class Sleak::Pair< T1, T2 >
A simple container for storing two values as a pair.
This class provides a way to store two values together as a single unit. It is similar to std::pair and can be used in similar situations, such as storing key-value pairs, coordinates, or any other data that needs to be grouped together.
Example Use Cases:
- Storing key-value pairs in a map or hash table.
- Representing coordinates (x, y) or (latitude, longitude).
- Returning multiple values from a function.
Implementation Details:
- Stores two values of potentially different types.
- Provides access to the values through first and second members.
- Implements comparison operators for lexicographical ordering.
- Offers a makePair function for convenient creation of Pair objects.
Definition at line 30 of file Pair.hpp.