3 Defines `boost::hana::comparing`.
5 @copyright Louis Dionne 2013-2016
6 Distributed under the Boost Software License, Version 1.0.
7 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
10 #ifndef BOOST_HANA_COMPARING_HPP
11 #define BOOST_HANA_COMPARING_HPP
13 #include <boost/hana/fwd/comparing.hpp>
15 #include <boost/hana/config.hpp>
16 #include <boost/hana/detail/decay.hpp>
17 #include <boost/hana/equal.hpp>
20 BOOST_HANA_NAMESPACE_BEGIN
26 template <typename X, typename Y>
27 constexpr auto operator()(X&& x, Y&& y) const&
28 { return hana::equal(f(static_cast<X&&>(x)), f(static_cast<Y&&>(y))); }
30 template <typename X, typename Y>
31 constexpr auto operator()(X&& x, Y&& y) &
32 { return hana::equal(f(static_cast<X&&>(x)), f(static_cast<Y&&>(y))); }
38 constexpr auto comparing_t::operator()(F&& f) const {
39 return detail::equal_by<typename detail::decay<F>::type>{static_cast<F&&>(f)};
42 BOOST_HANA_NAMESPACE_END
44 #endif // !BOOST_HANA_COMPARING_HPP