nested_to.hpp 788 B

12345678910111213141516171819202122232425262728
  1. /*!
  2. @file
  3. Defines `boost::hana::detail::nested_to`.
  4. @copyright Louis Dionne 2013-2017
  5. Distributed under the Boost Software License, Version 1.0.
  6. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  7. */
  8. #ifndef BOOST_HANA_DETAIL_NESTED_TO_HPP
  9. #define BOOST_HANA_DETAIL_NESTED_TO_HPP
  10. #include <boost/hana/detail/nested_to_fwd.hpp>
  11. #include <boost/hana/config.hpp>
  12. #include <boost/hana/functional/partial.hpp>
  13. BOOST_HANA_NAMESPACE_BEGIN namespace detail {
  14. //! @cond
  15. template <typename Algorithm>
  16. template <typename X>
  17. constexpr decltype(auto) nested_to_t<Algorithm>::operator()(X&& x) const
  18. { return hana::partial(Algorithm{}, static_cast<X&&>(x)); }
  19. //! @endcond
  20. } BOOST_HANA_NAMESPACE_END
  21. #endif // !BOOST_HANA_DETAIL_NESTED_TO_HPP