/* @copyright Louis Dionne 2014 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #include #include #include #include #include using namespace boost::hana; template void test() { constexpr auto comp = detail::minimal::comparable; BOOST_HANA_CONSTEXPR_LAMBDA auto comp_ = [=](auto i) { return [=] { return comp(i); }; }; BOOST_HANA_CONSTEXPR_LAMBDA auto equal_ = comparing([](auto x) { return x(); }); BOOST_HANA_CONSTEXPR_ASSERT(equal_(comp_(0), comp_(1)) == equal(comp(0), comp(1))); BOOST_HANA_CONSTEXPR_ASSERT(equal_(comp_(0), comp_(0)) == equal(comp(0), comp(0))); BOOST_HANA_CONSTEXPR_ASSERT(equal_(comp_(1), comp_(0)) == equal(comp(1), comp(0))); } int main() { test(); test(); }