/*! @file Defines `boost::hana::extract`. @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_EXTRACT_HPP #define BOOST_HANA_EXTRACT_HPP #include #include #include #include namespace boost { namespace hana { //! @cond template constexpr decltype(auto) extract_t::operator()(W_&& w) const { using W = typename hana::tag_of::type; using Extract = BOOST_HANA_DISPATCH_IF(extract_impl, hana::Comonad::value ); #ifndef BOOST_HANA_CONFIG_DISABLE_CONCEPT_CHECKS static_assert(hana::Comonad::value, "hana::extract(w) requires 'w' to be a Comonad"); #endif return Extract::apply(static_cast(w)); } //! @endcond template struct extract_impl> : default_ { template static constexpr auto apply(Args&& ...args) = delete; }; }} // end namespace boost::hana #endif // !BOOST_HANA_EXTRACT_HPP