github_165.cpp 670 B

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