1 // Copyright Louis Dionne 2013-2017
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
5 #include <boost/hana/assert.hpp>
7 #include <support/cnumeric.hpp>
8 namespace hana = boost::hana;
11 // This test makes sure that we can use lambdas inside the various
12 // BOOST_HANA_XXX_ASSERT macros.
15 bool runtime_bool() { return value; }
18 auto constant_bool() { return make_cnumeric<bool, value>(); }
21 BOOST_HANA_CONSTANT_ASSERT([]{ return constant_bool<true>(); }());
22 BOOST_HANA_RUNTIME_ASSERT([]{ return runtime_bool<true>(); }());
23 BOOST_HANA_ASSERT([] { return constant_bool<true>(); }());
24 BOOST_HANA_ASSERT([] { return runtime_bool<true>(); }());