]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/basic_tuple/cnstr.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/at.hpp>
7 #include <boost/hana/basic_tuple.hpp>
9 #include <laws/base.hpp>
12 namespace hana
= boost::hana
;
19 using T
= hana::basic_tuple
<>;
28 using T
= hana::basic_tuple
<int>;
31 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<0>(t
) == 2);
34 using T
= hana::basic_tuple
<int, char>;
37 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<0>(t
) == 2);
38 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<1>(t
) == 'a');
41 using T
= hana::basic_tuple
<int, char, std::string
>;
42 const T
t0(2, 'a', "some text");
44 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<0>(t
) == 2);
45 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<1>(t
) == 'a');
46 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<2>(t
) == "some text");
49 using T
= hana::basic_tuple
<int>;
52 static_assert(hana::at_c
<0>(t
) == 2, "");
55 using T
= hana::basic_tuple
<Empty
>;
58 constexpr Empty e
= hana::at_c
<0>(t
); (void)e
;
64 constexpr hana::basic_tuple
<T
, U
> binary
{};
65 constexpr hana::basic_tuple
<T
, U
> copy_implicit
= binary
;
66 constexpr hana::basic_tuple
<T
, U
> copy_explicit(binary
);