/*! @file Defines `boost::hana::value`. @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 BOOST_HANA_VALUE_HPP #define BOOST_HANA_VALUE_HPP #include #include #include #include #include #include namespace boost { namespace hana { template struct value_impl> : default_ { template static constexpr auto apply(Args&& ...args) = delete; }; template constexpr decltype(auto) value() { using RawT = typename std::remove_cv< typename std::remove_reference::type >::type; using C = typename hana::tag_of::type; using Value = BOOST_HANA_DISPATCH_IF( value_impl, hana::Constant::value ); #ifndef BOOST_HANA_CONFIG_DISABLE_CONCEPT_CHECKS static_assert(hana::Constant::value, "hana::value() requires 'T' to be a Constant"); #endif return Value::template apply(); } template struct value_impl::value>> { template static constexpr auto apply() { return C::value; } }; }} // end namespace boost::hana #endif // !BOOST_HANA_VALUE_HPP