summaryrefslogtreecommitdiff log msg author committer range
 ```1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 ``` ``````/*! @file Defines `boost::hana::detail::variadic::split_at`. @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_DETAIL_VARIADIC_SPLIT_AT_HPP #define BOOST_HANA_DETAIL_VARIADIC_SPLIT_AT_HPP #include #include #include #include BOOST_HANA_NAMESPACE_BEGIN namespace detail { namespace variadic { template struct split_at_t { template constexpr decltype(auto) operator()(F&& f, X1&& x1, X2&& x2, X3&& x3, X4&& x4, X5&& x5, X6&& x6, X7&& x7, X8&& x8, Xs&& ...xs) const { return split_at_t{}( hana::partial(static_cast(f), static_cast(x1), static_cast(x2), static_cast(x3), static_cast(x4), static_cast(x5), static_cast(x6), static_cast(x7), static_cast(x8) ), static_cast(xs)... ); } }; template <> struct split_at_t<0> { template constexpr decltype(auto) operator()(F&& f, Xs&& ...xs) const { return static_cast(f)()(static_cast(xs)...); } }; template <> struct split_at_t<1> { template constexpr decltype(auto) operator()(F&& f, X1&& x1, Xs&& ...xs) const { return static_cast(f)( static_cast(x1) )(static_cast(xs)...); } }; template <> struct split_at_t<2> { template constexpr decltype(auto) operator()(F&& f, X1&& x1, X2&& x2, Xs&& ...xs) const { return static_cast(f)( static_cast(x1), static_cast(x2) )(static_cast(xs)...); } }; template <> struct split_at_t<3> { template constexpr decltype(auto) operator()(F&& f, X1&& x1, X2&& x2, X3&& x3, Xs&& ...xs) const { return static_cast(f)( static_cast(x1), static_cast(x2), static_cast(x3) )(static_cast(xs)...); } }; template <> struct split_at_t<4> { template constexpr decltype(auto) operator()(F&& f, X1&& x1, X2&& x2, X3&& x3, X4&& x4, Xs&& ...xs) const { return static_cast(f)( static_cast(x1), static_cast(x2), static_cast(x3), static_cast(x4) )(static_cast(xs)...); } }; template <> struct split_at_t<5> { template constexpr decltype(auto) operator()(F&& f, X1&& x1, X2&& x2, X3&& x3, X4&& x4, X5&& x5, Xs&& ...xs) const { return static_cast(f)( static_cast(x1), static_cast(x2), static_cast(x3), static_cast(x4), static_cast(x5) )(static_cast(xs)...); } }; template <> struct split_at_t<6> { template constexpr decltype(auto) operator()(F&& f, X1&& x1, X2&& x2, X3&& x3, X4&& x4, X5&& x5, X6&& x6, Xs&& ...xs) const { return static_cast(f)( static_cast(x1), static_cast(x2), static_cast(x3), static_cast(x4), static_cast(x5), static_cast(x6) )(static_cast(xs)...); } }; template <> struct split_at_t<7> { template constexpr decltype(auto) operator()(F&& f, X1&& x1, X2&& x2, X3&& x3, X4&& x4, X5&& x5, X6&& x6, X7&& x7, Xs&& ...xs) const { return static_cast(f)( static_cast(x1), static_cast(x2), static_cast(x3), static_cast(x4), static_cast(x5), static_cast(x6), static_cast(x7) )(static_cast(xs)...); } }; template struct _makesplit_at_t { template constexpr decltype(auto) operator()(Xs&& ...xs) const { return hana::reverse_partial(split_at_t{}, static_cast(xs)...); } }; template constexpr _makesplit_at_t split_at{}; }} BOOST_HANA_NAMESPACE_END #endif // !BOOST_HANA_DETAIL_VARIADIC_SPLIT_AT_HPP ``````