copy.trap_construct.cpp 576 B

123456789101112131415161718192021
  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/optional.hpp>
  5. #include <laws/base.hpp>
  6. namespace hana = boost::hana;
  7. // This test makes sure that we do not instantiate rogue contructors when
  8. // trying to copy a hana::just.
  9. int main() {
  10. auto just = hana::just(hana::test::trap_construct{});
  11. auto implicit_copy = just;
  12. decltype(just) explicit_copy(just);
  13. (void)implicit_copy;
  14. (void)explicit_copy;
  15. }