| 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/tuple.hpp> |
| 6 | |
| 7 | #include <utility> |
| 8 | namespace hana = boost::hana; |
| 9 | |
| 10 | |
| 11 | constexpr int f() { |
| 12 | // copy-assign |
| 13 | { |
| 14 | hana::tuple<int> xs{1}; |
| 15 | hana::tuple<long> ys{1}; |
| 16 | xs = xs; |
| 17 | ys = xs; |
| 18 | } |
| 19 | |
| 20 | // move-assign |
| 21 | { |
| 22 | hana::tuple<int> xs{1}, xxs{1}; |
| 23 | hana::tuple<long> ys{1}; |
| 24 | xs = std::move(xxs); |
| 25 | ys = std::move(xs); |
| 26 | } |
| 27 | |
| 28 | return 0; |
| 29 | } |
| 30 | |
| 31 | static_assert(f() == 0, "" ); // force f() to be constexpr |
| 32 | |
| 33 | |
| 34 | int main() { } |
| 35 | |