]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/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/tuple.hpp>
9 namespace hana
= boost::hana
;
16 using T
= hana::tuple
<>;
25 using T
= hana::tuple
<int>;
28 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<0>(t
) == 2);
31 using T
= hana::tuple
<int, char>;
34 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<0>(t
) == 2);
35 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<1>(t
) == 'a');
38 using T
= hana::tuple
<int, char, std::string
>;
39 const T
t0(2, 'a', "some text");
41 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<0>(t
) == 2);
42 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<1>(t
) == 'a');
43 BOOST_HANA_RUNTIME_CHECK(hana::at_c
<2>(t
) == "some text");
46 using T
= hana::tuple
<int>;
49 static_assert(hana::at_c
<0>(t
) == 2, "");
52 using T
= hana::tuple
<Empty
>;
55 constexpr Empty e
= hana::at_c
<0>(t
); (void)e
;
61 constexpr hana::tuple
<T
, U
> binary
{};
62 constexpr hana::tuple
<T
, U
> copy_implicit
= binary
;
63 constexpr hana::tuple
<T
, U
> copy_explicit(binary
);