File indexing completed on 2025-01-18 09:38:02
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_HANA_COMPARING_HPP
0011 #define BOOST_HANA_COMPARING_HPP
0012
0013 #include <boost/hana/fwd/comparing.hpp>
0014
0015 #include <boost/hana/config.hpp>
0016 #include <boost/hana/detail/decay.hpp>
0017 #include <boost/hana/equal.hpp>
0018
0019
0020 namespace boost { namespace hana {
0021 namespace detail {
0022 template <typename F>
0023 struct equal_by {
0024 F f;
0025
0026 template <typename X, typename Y>
0027 constexpr auto operator()(X&& x, Y&& y) const&
0028 { return hana::equal(f(static_cast<X&&>(x)), f(static_cast<Y&&>(y))); }
0029
0030 template <typename X, typename Y>
0031 constexpr auto operator()(X&& x, Y&& y) &
0032 { return hana::equal(f(static_cast<X&&>(x)), f(static_cast<Y&&>(y))); }
0033 };
0034 }
0035
0036
0037 template <typename F>
0038 constexpr auto comparing_t::operator()(F&& f) const {
0039 return detail::equal_by<typename detail::decay<F>::type>{static_cast<F&&>(f)};
0040 }
0041
0042 }}
0043
0044 #endif