/*============================================================================= Copyright (c) 2011-2017 Bolero MURAKAMI https://github.com/bolero-MURAKAMI/Sprout Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ #ifndef SPROUT_UTILITY_PAIR_COMPARISON_HPP #define SPROUT_UTILITY_PAIR_COMPARISON_HPP #include #include namespace sprout { template inline SPROUT_CONSTEXPR bool operator==(sprout::pair const& x, sprout::pair const& y) { return x.first == y.first && x.second == y.second; } template inline SPROUT_CONSTEXPR bool operator!=(sprout::pair const& x, sprout::pair const& y) { return !(x == y); } template inline SPROUT_CONSTEXPR bool operator<(sprout::pair const& x, sprout::pair const& y) { return ((x.first) < (y.first)) || (!((y.first) < (x.first)) && ((x.second) < (y.second))); } template inline SPROUT_CONSTEXPR bool operator>(sprout::pair const& x, sprout::pair const& y) { return y < x; } template inline SPROUT_CONSTEXPR bool operator<=(sprout::pair const& x, sprout::pair const& y) { return !(y < x); } template inline SPROUT_CONSTEXPR bool operator>=(sprout::pair const& x, sprout::pair const& y) { return !(x < y); } } // namespace sprout #endif // #ifndef SPROUT_UTILITY_PAIR_COMPARISON_HPP