]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/tuple/assign.convert_copy.cpp
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/tuple.hpp>
7 namespace hana
= boost::hana
;
12 explicit B(int i
= 0) : id_(i
) { }
16 explicit D(int i
= 0) : B(i
) { }
21 using T0
= hana::tuple
<double>;
22 using T1
= hana::tuple
<int>;
26 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<0>(t1
) == 2);
29 using T0
= hana::tuple
<double, char>;
30 using T1
= hana::tuple
<int, int>;
34 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<0>(t1
) == 2);
35 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<1>(t1
) == int('a'));
38 using T0
= hana::tuple
<double, char, D
>;
39 using T1
= hana::tuple
<int, int, B
>;
40 T0
t0(2.5, 'a', D(3));
43 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<0>(t1
) == 2);
44 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<1>(t1
) == int('a'));
45 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<2>(t1
).id_
== 3);
50 using T0
= hana::tuple
<double, char, D
&>;
51 using T1
= hana::tuple
<int, int, B
&>;
55 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<0>(t1
) == 2);
56 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<1>(t1
) == int('a'));
57 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<2>(t1
).id_
== 2);