]>
Commit | Line | Data |
---|---|---|
b32b8144 | 1 | // Copyright Louis Dionne 2013-2017 |
7c673cae FG |
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/experimental/view.hpp> | |
7 | #include <boost/hana/less.hpp> | |
8 | #include <boost/hana/not.hpp> | |
9 | ||
10 | #include <laws/base.hpp> | |
11 | #include <support/seq.hpp> | |
12 | namespace hana = boost::hana; | |
13 | using hana::test::ct_ord; | |
14 | ||
15 | ||
16 | int main() { | |
17 | auto container = ::seq; | |
18 | auto f = hana::test::_injection<0>{}; | |
19 | ||
20 | { | |
21 | auto storage = container(); | |
22 | auto transformed = hana::experimental::transformed(storage, f); | |
23 | BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::less( | |
24 | transformed, | |
25 | container() | |
26 | ))); | |
27 | }{ | |
28 | auto storage = container(ct_ord<0>{}); | |
29 | auto transformed = hana::experimental::transformed(storage, f); | |
30 | BOOST_HANA_CONSTANT_CHECK(hana::less( | |
31 | container(), | |
32 | transformed | |
33 | )); | |
34 | BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::less( | |
35 | container(f(ct_ord<0>{})), | |
36 | transformed | |
37 | ))); | |
38 | BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::less( | |
39 | transformed, | |
40 | container() | |
41 | ))); | |
42 | }{ | |
43 | auto storage = container(ct_ord<0>{}, ct_ord<1>{}); | |
44 | auto transformed = hana::experimental::transformed(storage, f); | |
45 | BOOST_HANA_CONSTANT_CHECK(hana::less( | |
46 | container(), | |
47 | transformed | |
48 | )); | |
49 | BOOST_HANA_CONSTANT_CHECK(hana::less( | |
50 | container(f(ct_ord<0>{})), | |
51 | transformed | |
52 | )); | |
53 | BOOST_HANA_CONSTANT_CHECK(hana::less( | |
54 | container(f(ct_ord<0>{}), f(ct_ord<0>{})), | |
55 | transformed | |
56 | )); | |
57 | } | |
58 | } |