#pragma GCC system_header #ifndef _LIBCXX_UTILITY #define _LIBCXX_UTILITY #include <__config> #include _LIBCXX_BEGIN_NAMESPACE_STD template inline T&& move(T& arg) { return static_cast(arg); } template inline void swap(T& a, U& b) { U tmp = move((U&)a); a = (T &&) move(b); b = move(tmp); } template static constexpr T&& forward(std::remove_reference_t& t) { return static_cast(t); } template static constexpr T&& forward(std::remove_reference_t&& t) { return static_cast(t); } struct in_place_t { explicit in_place_t() = default; }; inline constexpr in_place_t in_place {}; template struct pair { using first_type = T1; using second_type = T2; constexpr pair() = default; constexpr ~pair() = default; constexpr pair(const T1& x, const T2& y) : first(x) , second(y) { } template constexpr pair(U1&& x, U2&& y) : first(std::forward(x)) , second(std::forward(y)) { } constexpr pair(const pair& p) : first(p.first) , second(p.second) { } template constexpr pair(pair&& p) : first(std::move(p.first)) , second(std::move(p.second)) { } T1 first {}; T2 second {}; }; template constexpr bool operator==(const std::pair& lhs, const std::pair& rhs) { return lhs.first == rhs.first && lhs.second == rhs.second; } template constexpr bool operator!=(const std::pair& lhs, const std::pair& rhs) { return !(lhs == rhs); } template constexpr bool operator<(const std::pair& lhs, const std::pair& rhs) { return (lhs.first < rhs.first) || (lhs.first == rhs.first && lhs.second < rhs.second); } template constexpr bool operator<=(const std::pair& lhs, const std::pair& rhs) { return (lhs < rhs) || (lhs == rhs); } template constexpr bool operator>(const std::pair& lhs, const std::pair& rhs) { return (lhs.first > rhs.first) || (lhs.first == rhs.first && lhs.second > rhs.second); } template constexpr bool operator>=(const std::pair& lhs, const std::pair& rhs) { return (lhs > rhs) || (lhs == rhs); } // TODO: Use decay for return types template std::pair make_pair(T1&& l, T2&& r) { return std::pair(std::forward(l), std::forward(r)); } _LIBCXX_END_NAMESPACE_STD #endif // _LIBCXX_UTILITY