1// Copyright Louis Dionne 2013-2022
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/tuple.hpp>
7
8#include <string>
9namespace hana = boost::hana;
10
11
12int main() {
13 {
14 using T = hana::tuple<>;
15 T t0;
16 T t;
17 t = t0;
18 }
19 {
20 using T = hana::tuple<int>;
21 T t0(2);
22 T t;
23 t = t0;
24 BOOST_HANA_RUNTIME_CHECK(hana::at_c<0>(t) == 2);
25 }
26 {
27 using T = hana::tuple<int, char>;
28 T t0(2, 'a');
29 T t;
30 t = t0;
31 BOOST_HANA_RUNTIME_CHECK(hana::at_c<0>(t) == 2);
32 BOOST_HANA_RUNTIME_CHECK(hana::at_c<1>(t) == 'a');
33 }
34 {
35 using T = hana::tuple<int, char, std::string>;
36 const T t0(2, 'a', "some text");
37 T t;
38 t = t0;
39 BOOST_HANA_RUNTIME_CHECK(hana::at_c<0>(t) == 2);
40 BOOST_HANA_RUNTIME_CHECK(hana::at_c<1>(t) == 'a');
41 BOOST_HANA_RUNTIME_CHECK(hana::at_c<2>(t) == "some text");
42 }
43}
44

source code of boost/libs/hana/test/tuple/assign.copy.cpp