diff options
Diffstat (limited to 'boost/hana/fwd/take_back.hpp')
-rw-r--r-- | boost/hana/fwd/take_back.hpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/boost/hana/fwd/take_back.hpp b/boost/hana/fwd/take_back.hpp index fa4dde5e3c..5ba1cf932f 100644 --- a/boost/hana/fwd/take_back.hpp +++ b/boost/hana/fwd/take_back.hpp @@ -53,6 +53,26 @@ BOOST_HANA_NAMESPACE_BEGIN constexpr take_back_t take_back{}; #endif + + //! Equivalent to `take_back`; provided for convenience. + //! @ingroup group-Sequence + //! + //! + //! Example + //! ------- + //! @include example/take_back_c.cpp +#ifdef BOOST_HANA_DOXYGEN_INVOKED + template <std::size_t n> + constexpr auto take_back_c = [](auto&& xs) { + return hana::take_back(forwarded(xs), hana::size_c<n>); + }; +#else + template <std::size_t n> + struct take_back_c_t; + + template <std::size_t n> + constexpr take_back_c_t<n> take_back_c{}; +#endif BOOST_HANA_NAMESPACE_END #endif // !BOOST_HANA_FWD_TAKE_BACK_HPP |