11 #ifndef INLCUDE_MOLASSEMBLER_TEMPLE_PAIR_H
12 #define INLCUDE_MOLASSEMBLER_TEMPLE_PAIR_H
19 namespace Molassembler {
26 template<
typename T,
typename U>
36 constexpr
Pair() : first(T {}), second (U {}) {}
39 constexpr
Pair(
const T& passFirst,
const U& passSecond)
40 : first(passFirst), second(passSecond)
44 constexpr
Pair(T&& passFirst, U&& passSecond)
45 : first(passFirst), second(passSecond)
53 : first(other.first), second(other.second) {}
56 : first(std::move(other.first)), second(std::move(other.second)) {}
60 second = other.second;
66 first = std::move(other.first);
67 second = std::move(other.second);
78 if(first > other.first) {
82 if(first == other.first) {
83 return second < other.second;
91 return (other < *
this);
98 && second == other.second
104 return !(*
this == other);
~Pair()=default
Copy constructor.
#define PURITY_WEAK
Definition: Preprocessor.h:36
Heterogeneous pair type.
Definition: Pair.h:27
constexpr Pair & operator=(const Pair &other)
Copy assignment.
Definition: Pair.h:58
PURITY_WEAK constexpr bool operator<(const Pair &other) const
Lexicographical comparison.
Definition: Pair.h:77
Defines a set of useful preprocessor macros.
constexpr Pair()
Value constructor by copy.
Definition: Pair.h:36
PURITY_WEAK constexpr bool operator>(const Pair &other) const
Lexicographical comparison.
Definition: Pair.h:90
constexpr Pair(T &&passFirst, U &&passSecond)
Value constructor by move.
Definition: Pair.h:44
PURITY_WEAK constexpr bool operator!=(const Pair &other) const
Lexicographical comparison.
Definition: Pair.h:103
constexpr Pair(Pair &&other) noexcept
Move constructor.
Definition: Pair.h:55
constexpr Pair(const Pair &other)
Copy constructor.
Definition: Pair.h:52
constexpr Pair(const T &passFirst, const U &passSecond)
Value constructor by copy.
Definition: Pair.h:39
PURITY_WEAK constexpr bool operator==(const Pair &other) const
Lexicographical comparison.
Definition: Pair.h:95