/*! @file Defines `boost::hana::lift`. @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_LIFT_HPP #define BOOST_HANA_LIFT_HPP #include #include #include #include #include #include BOOST_HANA_NAMESPACE_BEGIN //! @cond template template constexpr auto lift_t::operator()(X&& x) const { #ifndef BOOST_HANA_CONFIG_DISABLE_CONCEPT_CHECKS static_assert(hana::Applicative::value, "hana::lift requires 'A' to be an Applicative"); #endif using Lift = BOOST_HANA_DISPATCH_IF(lift_impl, hana::Applicative::value ); return Lift::apply(static_cast(x)); } //! @endcond template struct lift_impl> : default_ { template static constexpr auto apply(Args&& ...args) = delete; }; template struct lift_impl::value>> { template static constexpr decltype(auto) apply(X&& x) { return hana::make(static_cast(x)); } }; BOOST_HANA_NAMESPACE_END #endif // !BOOST_HANA_LIFT_HPP