// 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_CONCEPT_CONSTANT_MINIMAL_HPP #define TEST_CONCEPT_CONSTANT_MINIMAL_HPP #include #include #include #include template struct minimal_constant_tag { using value_type = T; }; template struct minimal_constant { using hana_tag = minimal_constant_tag; static constexpr T value_ = v; }; namespace boost { namespace hana { template struct value_impl> { template static constexpr T apply() { return N::value_; } }; template struct to_impl, C, hana::when< hana::Constant::value && hana::is_convertible::value >> : hana::embedding::value> { template static constexpr auto apply(N const&) { return minimal_constant()>{}; } }; }} // end namespace boost::hana #endif // !TEST_CONCEPT_CONSTANT_MINIMAL_HPP