fennec
Loading...
Searching...
No Matches
fennec::pair< TypeT0, TypeT1 >

Struct for holding a pair of values. More...

#include <pair.h>

Detailed Description

template<typename TypeT0, typename TypeT1>
struct fennec::pair< TypeT0, TypeT1 >
Template Parameters
TypeT0The type of the first value
TypeT1The type of the second value

Public Member Functions

Constructors & Destructor
constexpr pair ()=default
 Default Constructor, invokes default constructor for both elements.
 
constexpr ~pair ()=default
 Destructor, invokes destructor for both elements.
 
constexpr pair (const TypeT0 &x, const TypeT1 &y)
 Pair Copy Constructor.
 
constexpr pair (TypeT0 &&x, TypeT1 &&y) noexcept
 Pair Move Constructor.
 
template<typename Arg1T , typename Arg2T >
constexpr pair (Arg1T &&arg1, Arg2T &&arg2)
 Pair Implicit Constructor.
 
constexpr pair (const pair &pair)
 Copy Constructor, copies both elements.
 
constexpr pair (pair &&pair) noexcept
 Move Constructor, moves both elements.
 
constexpr pairoperator= (const pair &pair)
 Copy Assignment, copies both elements.
 
constexpr pairoperator= (pair &&pair)
 Move Assignment, moves both elements.
 
Comparison
constexpr bool operator== (const pair &p) const
 Equality Operator.
 
constexpr bool operator!= (const pair &p) const
 Inequality Operator.
 
constexpr bool operator< (const pair &p) const
 Less Than Operator.
 
constexpr bool operator<= (const pair &p) const
 Less Equal Operator.
 
constexpr bool operator> (const pair &p) const
 Greater Than Operator.
 
constexpr bool operator>= (const pair &p) const
 Greater Equal Operator.
 

Public Attributes

TypeT0 first
 The first value in the pair.
 
TypeT1 second
 The second value in the pair.
 

Constructor & Destructor Documentation

◆ pair() [1/3]

template<typename TypeT0 , typename TypeT1 >
constexpr fennec::pair< TypeT0, TypeT1 >::pair ( const TypeT0 &  x,
const TypeT1 &  y 
)
inlineconstexpr
Parameters
xValue to copy for the first element
yValue to copy for the first element

◆ pair() [2/3]

template<typename TypeT0 , typename TypeT1 >
constexpr fennec::pair< TypeT0, TypeT1 >::pair ( TypeT0 &&  x,
TypeT1 &&  y 
)
inlineconstexprnoexcept
Parameters
xValue to move for the first element
yValue to move for the first element

◆ pair() [3/3]

template<typename TypeT0 , typename TypeT1 >
template<typename Arg1T , typename Arg2T >
constexpr fennec::pair< TypeT0, TypeT1 >::pair ( Arg1T &&  arg1,
Arg2T &&  arg2 
)
inlineconstexpr
Parameters
arg1Value to initialize the first element
arg2Value to initialize the first element

Member Function Documentation

◆ operator==()

template<typename TypeT0 , typename TypeT1 >
constexpr bool fennec::pair< TypeT0, TypeT1 >::operator== ( const pair< TypeT0, TypeT1 > &  p) const
inlineconstexpr
Parameters
pPair to compare with
Returns
true when both elements of each pair are equal

◆ operator!=()

template<typename TypeT0 , typename TypeT1 >
constexpr bool fennec::pair< TypeT0, TypeT1 >::operator!= ( const pair< TypeT0, TypeT1 > &  p) const
inlineconstexpr
Parameters
pPair to compare with
Returns
true when either element of each pair are equal

◆ operator<()

template<typename TypeT0 , typename TypeT1 >
constexpr bool fennec::pair< TypeT0, TypeT1 >::operator< ( const pair< TypeT0, TypeT1 > &  p) const
inlineconstexpr
Parameters
pPair to compare with
Returns
lexical comparison of both elements, i.e. returns true when the first element is less, or they are equal and the second element is less

◆ operator<=()

template<typename TypeT0 , typename TypeT1 >
constexpr bool fennec::pair< TypeT0, TypeT1 >::operator<= ( const pair< TypeT0, TypeT1 > &  p) const
inlineconstexpr
Parameters
pPair to compare with
Returns
lexical comparison of both elements, i.e. returns true when the first element is less, or they are equal and the second element is less or equal

◆ operator>()

template<typename TypeT0 , typename TypeT1 >
constexpr bool fennec::pair< TypeT0, TypeT1 >::operator> ( const pair< TypeT0, TypeT1 > &  p) const
inlineconstexpr
Parameters
pPair to compare with
Returns
lexical comparison of both elements, i.e. returns true when the first element is greater, or they are equal and the second element is greater

◆ operator>=()

template<typename TypeT0 , typename TypeT1 >
constexpr bool fennec::pair< TypeT0, TypeT1 >::operator>= ( const pair< TypeT0, TypeT1 > &  p) const
inlineconstexpr
Parameters
pPair to compare with
Returns
lexical comparison of both elements, i.e. returns true when the first element is greater, or they are equal and the second element is greater or equal

The documentation for this struct was generated from the following file: