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>
6 #include <boost/hana/concat.hpp>
7 #include <boost/hana/equal.hpp>
8 #include <boost/hana/optional.hpp>
10 #include <laws/base.hpp>
11 namespace hana = boost::hana;
12 using hana::test::ct_eq;
16 auto rv_nothing = [] { return hana::nothing; }; // rvalue nothing
18 BOOST_HANA_CONSTANT_CHECK(hana::equal(
19 hana::concat(rv_nothing(), hana::nothing),
22 BOOST_HANA_CONSTANT_CHECK(hana::equal(
23 hana::concat(hana::nothing, rv_nothing()),
26 BOOST_HANA_CONSTANT_CHECK(hana::equal(
27 hana::concat(rv_nothing(), rv_nothing()),
30 BOOST_HANA_CONSTANT_CHECK(hana::equal(
31 hana::concat(rv_nothing(), hana::just(ct_eq<0>{})),
32 hana::just(ct_eq<0>{})
34 BOOST_HANA_CONSTANT_CHECK(hana::equal(
35 hana::concat(hana::just(ct_eq<0>{}), rv_nothing()),
36 hana::just(ct_eq<0>{})
39 BOOST_HANA_CONSTANT_CHECK(hana::equal(
40 hana::concat(hana::nothing, hana::nothing),
43 BOOST_HANA_CONSTANT_CHECK(hana::equal(
44 hana::concat(hana::nothing, hana::just(ct_eq<0>{})),
45 hana::just(ct_eq<0>{})
47 BOOST_HANA_CONSTANT_CHECK(hana::equal(
48 hana::concat(hana::just(ct_eq<0>{}), hana::nothing),
49 hana::just(ct_eq<0>{})
51 BOOST_HANA_CONSTANT_CHECK(hana::equal(
52 hana::concat(hana::just(ct_eq<0>{}), hana::just(ct_eq<1>{})),
53 hana::just(ct_eq<0>{})