| 21 | // because both are implemented similarly. |
| 22 | |
| 23 | int main() { |
| 24 | { |
| 25 | using Nested = hana::pair<hana::int_<1>, hana::int_<2>>; |
| 26 | using Pair = hana::pair<hana::int_<0>, Nested>; |
| 27 | Pair pair{}; |
| 28 | |
| 29 | auto a = hana::first(pair); |
| 30 | static_assert(std::is_same<decltype(a), hana::int_<0>>{}, ""); |
| 31 | |
| 32 | auto b = hana::second(pair); |
| 33 | static_assert(std::is_same<decltype(b), Nested>{}, ""); |
| 34 | } |
| 35 | |
| 36 | { |
| 37 | using Nested = hana::basic_tuple<hana::int_<1>, hana::int_<2>>; |
| 38 | using Tuple = hana::basic_tuple<hana::int_<0>, Nested>; |
| 39 | Tuple tuple{}; |
| 40 | |
| 41 | auto a = hana::at_c<0>(tuple); |
| 42 | static_assert(std::is_same<decltype(a), hana::int_<0>>{}, ""); |
| 43 | |
| 44 | auto b = hana::at_c<1>(tuple); |
| 45 | static_assert(std::is_same<decltype(b), Nested>{}, ""); |
| 46 | } |
| 47 | |
| 48 | // Original test case submitted by Vittorio Romeo |
| 49 | { |
| 50 | hana::pair<hana::int_<1>, hana::bool_<false>> p{}; |
| 51 | auto copy = hana::make_pair(hana::int_c<0>, p); |
| 52 | auto move = hana::make_pair(hana::int_c<0>, std::move(p)); |
| 53 | |
| 54 | copy = move; // copy assign |
| 55 | copy = std::move(move); // move assign |
| 56 | } |
| 57 | } |