31#ifndef FENNEC_CONTAINERS_PAIR_H
32#define FENNEC_CONTAINERS_PAIR_H
35#include <fennec/lang/hashing.h>
47template<
typename TypeT0,
typename TypeT1>
62 constexpr pair() =
default;
72 constexpr pair(
const TypeT0& x,
const TypeT1& y)
81 constexpr pair(TypeT0&& x, TypeT1&& y) noexcept
82 :
first(fennec::forward<TypeT0>(x))
83 ,
second(fennec::forward<TypeT1>(y)) {
90 template<
typename Arg1T,
typename Arg2T>
91 constexpr pair(Arg1T&& arg1, Arg2T&& arg2)
189template<
typename TypeT0,
typename TypeT1>
190struct hash<pair<TypeT0, TypeT1>> : hash<TypeT0>, hash<TypeT1> {
191 constexpr size_t operator()(
const pair<TypeT0, TypeT1>& p)
const {
192 return fennec::pair_hash(
193 hash<TypeT0>::operator()(p.first),
194 hash<TypeT1>::operator()(p.second)
constexpr genType y()
Definition constants.h:672
Struct for holding a pair of values.
Definition pair.h:48
TypeT1 second
The second value in the pair.
Definition pair.h:53
constexpr bool operator>(const pair &p) const
Greater Than Operator.
Definition pair.h:173
constexpr pair(const pair &pair)
Copy Constructor, copies both elements.
Definition pair.h:98
constexpr bool operator<(const pair &p) const
Less Than Operator.
Definition pair.h:155
constexpr pair(pair &&pair) noexcept
Move Constructor, moves both elements.
Definition pair.h:105
constexpr bool operator>=(const pair &p) const
Greater Equal Operator.
Definition pair.h:182
constexpr ~pair()=default
Destructor, invokes destructor for both elements.
constexpr bool operator!=(const pair &p) const
Inequality Operator.
Definition pair.h:146
constexpr pair & operator=(const pair &pair)
Copy Assignment, copies both elements.
Definition pair.h:112
constexpr bool operator<=(const pair &p) const
Less Equal Operator.
Definition pair.h:164
constexpr pair(Arg1T &&arg1, Arg2T &&arg2)
Pair Implicit Constructor.
Definition pair.h:91
constexpr pair(const TypeT0 &x, const TypeT1 &y)
Pair Copy Constructor.
Definition pair.h:72
constexpr pair()=default
Default Constructor, invokes default constructor for both elements.
constexpr pair & operator=(pair &&pair)
Move Assignment, moves both elements.
Definition pair.h:120
TypeT0 first
The first value in the pair.
Definition pair.h:52
constexpr bool operator==(const pair &p) const
Equality Operator.
Definition pair.h:138
constexpr pair(TypeT0 &&x, TypeT1 &&y) noexcept
Pair Move Constructor.
Definition pair.h:81
A header containing the definition for a container with multiple values of differing types.
constexpr T && forward(remove_reference_t< T > &x) noexcept
forwards reference types to extend their lifetime
Definition utility.h:75
constexpr const remove_reference_t< T > & copy(T &&x) noexcept
produces an r-value type to indicate x may be "copied"
Definition utility.h:104
constexpr remove_reference_t< T > && move(T &&x) noexcept
produces an x-value type to indicate x may be "moved"
Definition utility.h:92