1 /*=============================================================================
2 Copyright (c) 2016 Paul Fultz II
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
8 #ifndef BOOST_HOF_GUARD_UNPACK_SEQUENCE_HPP
9 #define BOOST_HOF_GUARD_UNPACK_SEQUENCE_HPP
14 /// How to unpack a sequence can be defined by specializing `unpack_sequence`.
15 /// By default, `std::tuple` is already specialized. To implement this, one
16 /// needs to provide a static `apply` function which will unpack the sequence
17 /// to the parameters of the function.
22 /// template<class Sequence, class=void>
23 /// struct unpack_sequence;
28 /// #include <boost/hof.hpp>
29 /// #include <cassert>
31 /// struct my_sequence
37 /// namespace boost { namespace hof {
39 /// struct unpack_sequence<my_sequence>
41 /// template<class F, class Sequence>
42 /// constexpr static auto apply(F&& f, Sequence&& s) BOOST_HOF_RETURNS
47 /// }} // namespace boost::hof
55 /// * [unpack](unpack)
56 /// * [is_unpackable](is_unpackable)
59 #include <boost/hof/config.hpp>
61 namespace boost { namespace hof {
63 template<class Sequence, class=void>
64 struct unpack_sequence
66 typedef void not_unpackable;
69 }} // namespace boost::hof