// 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) #ifndef TEST_SUPPORT_CONSTEXPR_MOVE_ONLY_HPP #define TEST_SUPPORT_CONSTEXPR_MOVE_ONLY_HPP #include #include #include #include // A move-only type that's also a literal type. It is also Comparable and // Hashable so it can be used in associative containers. template struct ConstexprMoveOnly { constexpr ConstexprMoveOnly() { } constexpr ConstexprMoveOnly(ConstexprMoveOnly const&) = delete; constexpr ConstexprMoveOnly& operator=(ConstexprMoveOnly const&) = delete; constexpr ConstexprMoveOnly(ConstexprMoveOnly&&) { } }; template constexpr auto operator==(ConstexprMoveOnly const&, ConstexprMoveOnly const&) { return boost::hana::bool_c; } template constexpr auto operator!=(ConstexprMoveOnly const&, ConstexprMoveOnly const&) { return boost::hana::bool_c; } namespace boost { namespace hana { template struct hash_impl> { static constexpr auto apply(ConstexprMoveOnly const&) { return hana::type_c>; }; }; }} #endif // !TEST_SUPPORT_CONSTEXPR_MOVE_ONLY_HPP