diff options
Diffstat (limited to 'boost/hana/equal.hpp')
-rw-r--r-- | boost/hana/equal.hpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/boost/hana/equal.hpp b/boost/hana/equal.hpp index 498f7a8a2b..8eb0912fca 100644 --- a/boost/hana/equal.hpp +++ b/boost/hana/equal.hpp @@ -63,7 +63,11 @@ BOOST_HANA_NAMESPACE_BEGIN "types that can't be safely embedded into a common type, because " "those are most likely programming errors. If this is really what " "you want, you can manually convert both objects to a common " - "Comparable type before performing the comparison."); + "Comparable type before performing the comparison. If you think " + "you have made your types Comparable but you see this, perhaps you " + "forgot to define some of the necessary methods for an automatic " + "model of Comparable to kick in. A possible culprit is defining " + "'operator==' but not 'operator!='."); return hana::false_c; } @@ -105,7 +109,7 @@ BOOST_HANA_NAMESPACE_BEGIN static constexpr auto apply(X const&, Y const&) { constexpr auto eq = hana::equal(hana::value<X>(), hana::value<Y>()); constexpr bool truth_value = hana::if_(eq, true, false); - return hana::bool_c<truth_value>; + return hana::bool_<truth_value>{}; } }; @@ -135,7 +139,7 @@ BOOST_HANA_NAMESPACE_BEGIN template <std::size_t i> constexpr auto apply(hana::false_, hana::true_) const { return compare_finite_sequences::apply<i+1>( - hana::bool_c<i+1 == Length>, + hana::bool_<i+1 == Length>{}, hana::if_(hana::equal(hana::at_c<i>(xs), hana::at_c<i>(ys)), hana::true_c, hana::false_c) ); @@ -152,7 +156,7 @@ BOOST_HANA_NAMESPACE_BEGIN template <std::size_t i> constexpr bool apply(hana::false_, bool b) const { return b && compare_finite_sequences::apply<i+1>( - hana::bool_c<i+1 == Length>, + hana::bool_<i+1 == Length>{}, hana::if_(hana::equal(hana::at_c<i>(xs), hana::at_c<i>(ys)), hana::true_c, hana::false_c) ); @@ -167,8 +171,8 @@ BOOST_HANA_NAMESPACE_BEGIN constexpr std::size_t xs_size = decltype(hana::length(xs))::value; constexpr std::size_t ys_size = decltype(hana::length(ys))::value; detail::compare_finite_sequences<Xs, Ys, xs_size> comp{xs, ys}; - return comp.template apply<0>(hana::bool_c<xs_size == 0>, - hana::bool_c<xs_size == ys_size>); + return comp.template apply<0>(hana::bool_<xs_size == 0>{}, + hana::bool_<xs_size == ys_size>{}); } }; |