diff options
Diffstat (limited to 'src/boost/libs/hana/test/set/cnstr.move.cpp')
-rw-r--r-- | src/boost/libs/hana/test/set/cnstr.move.cpp | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/boost/libs/hana/test/set/cnstr.move.cpp b/src/boost/libs/hana/test/set/cnstr.move.cpp new file mode 100644 index 00000000..e1a98511 --- /dev/null +++ b/src/boost/libs/hana/test/set/cnstr.move.cpp @@ -0,0 +1,63 @@ +// Copyright Louis Dionne 2013-2017 +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + +#include <boost/hana/bool.hpp> +#include <boost/hana/fwd/hash.hpp> +#include <boost/hana/set.hpp> +#include <boost/hana/type.hpp> + +#include <support/constexpr_move_only.hpp> +#include <support/tracked_move_only.hpp> + +#include <utility> +namespace hana = boost::hana; + + +constexpr bool in_constexpr_context() { + auto t0 = hana::make_set(ConstexprMoveOnly<2>{}, ConstexprMoveOnly<3>{}); + auto t_implicit = std::move(t0); + auto t_explicit(std::move(t_implicit)); + + (void)t_implicit; + (void)t_explicit; + return true; +} + +static_assert(in_constexpr_context(), ""); + + +int main() { + { + auto t0 = hana::make_set(); + auto t_implicit = std::move(t0); + auto t_explicit(std::move(t_implicit)); + + (void)t_explicit; + (void)t_implicit; + } + { + auto t0 = hana::make_set(TrackedMoveOnly<1>{}); + auto t_implicit = std::move(t0); + auto t_explicit(std::move(t_implicit)); + + (void)t_implicit; + (void)t_explicit; + } + { + auto t0 = hana::make_set(TrackedMoveOnly<1>{}, TrackedMoveOnly<2>{}); + auto t_implicit = std::move(t0); + auto t_explicit(std::move(t_implicit)); + + (void)t_implicit; + (void)t_explicit; + } + { + auto t0 = hana::make_set(TrackedMoveOnly<1>{}, TrackedMoveOnly<2>{}, TrackedMoveOnly<3>{}); + auto t_implicit = std::move(t0); + auto t_explicit(std::move(t_implicit)); + + (void)t_implicit; + (void)t_explicit; + } +} |