/// \file // Range v3 library // // Copyright Eric Niebler 2013-present // Copyright Casey Carter 2016 // // Use, modification and distribution is subject to 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) // // Project home: https://github.com/ericniebler/range-v3 // #ifndef RANGES_V3_FUNCTIONAL_COMPARISONS_HPP #define RANGES_V3_FUNCTIONAL_COMPARISONS_HPP #include #include namespace ranges { /// \addtogroup group-functional /// @{ struct equal_to { template constexpr auto operator()(T && t, U && u) const -> CPP_ret(bool)( // requires equality_comparable_with) { return (T &&) t == (U &&) u; } using is_transparent = void; }; struct not_equal_to { template constexpr auto operator()(T && t, U && u) const -> CPP_ret(bool)( // requires equality_comparable_with) { return !equal_to{}((T &&) t, (U &&) u); } using is_transparent = void; }; struct less { template constexpr auto operator()(T && t, U && u) const -> CPP_ret(bool)( // requires totally_ordered_with) { return (T &&) t < (U &&) u; } using is_transparent = void; }; struct less_equal { template constexpr auto operator()(T && t, U && u) const -> CPP_ret(bool)( // requires totally_ordered_with) { return !less{}((U &&) u, (T &&) t); } using is_transparent = void; }; struct greater_equal { template constexpr auto operator()(T && t, U && u) const -> CPP_ret(bool)( // requires totally_ordered_with) { return !less{}((T &&) t, (U &&) u); } using is_transparent = void; }; struct greater { template constexpr auto operator()(T && t, U && u) const -> CPP_ret(bool)( // requires totally_ordered_with) { return less{}((U &&) u, (T &&) t); } using is_transparent = void; }; using ordered_less RANGES_DEPRECATED( "Repace uses of ranges::ordered_less with ranges::less") = less; namespace cpp20 { using ranges::equal_to; using ranges::greater; using ranges::greater_equal; using ranges::less; using ranges::less_equal; using ranges::not_equal_to; } // namespace cpp20 /// @} } // namespace ranges #endif