2023-06-07 08:24:10 -07:00
|
|
|
#pragma once
|
|
|
|
|
2023-11-16 22:12:00 -08:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "glacier/memory/move.h"
|
|
|
|
|
2023-06-21 20:47:40 -07:00
|
|
|
namespace glcr {
|
|
|
|
|
2023-06-07 08:24:10 -07:00
|
|
|
template <typename T, typename U>
|
|
|
|
class Pair {
|
|
|
|
public:
|
|
|
|
Pair(const T& first, const U& second) : first_(first), second_(second) {}
|
2023-11-16 22:12:00 -08:00
|
|
|
Pair(T&& first, U&& second) : first_(Move(first)), second_(Move(second)) {}
|
2023-06-07 08:24:10 -07:00
|
|
|
T& first() { return first_; }
|
|
|
|
U& second() { return second_; }
|
|
|
|
|
2023-11-16 22:12:00 -08:00
|
|
|
bool operator==(const Pair& other) {
|
|
|
|
return other.first_ == first_ && other.second_ == second_;
|
|
|
|
}
|
|
|
|
|
2023-06-07 08:24:10 -07:00
|
|
|
private:
|
|
|
|
T first_;
|
|
|
|
U second_;
|
|
|
|
};
|
2023-06-21 20:47:40 -07:00
|
|
|
|
|
|
|
} // namespace glcr
|