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) 4 5 #include <boost/hana/assert.hpp> 6 #include <boost/hana/bool.hpp> 7 #include <boost/hana/config.hpp> 8 #include <boost/hana/eval.hpp> 9 #include <boost/hana/if.hpp> 10 #include <boost/hana/lazy.hpp> 11 namespace hana = boost::hana; 12 13 main()14int main() { 15 BOOST_HANA_CONSTEXPR_LAMBDA auto f = hana::make<hana::lazy_tag>([](auto x) { 16 return 1 / x; 17 }); 18 19 BOOST_HANA_CONSTEXPR_LAMBDA auto g = hana::make_lazy([](auto x) { 20 return x + 1; 21 }); 22 23 BOOST_HANA_CONSTEXPR_CHECK(hana::eval(hana::if_(hana::false_c, f(0), g(0))) == 0 + 1); 24 } 25