38#include <initializer_list>
43#if !defined(PTL_FOLD_EXPRESSION)
44# define PTL_FOLD_EXPRESSION(...) \
45 ::PTL::mpl::consume_parameters( \
46 ::std::initializer_list<int>{ (__VA_ARGS__, 0)... })
52using decay_t =
typename std::decay<T>::type;
54template <
bool B,
typename T =
void>
62template <
typename... Args>
74template <
size_t... Indexes>
79template <
typename Itup1,
typename Itup2>
82template <
size_t... Ind1,
size_t... Ind2>
91:
Itup_cat<typename Build_index_tuple<NumT / 2>::__type,
92 typename Build_index_tuple<NumT - NumT / 2>::__type>
108template <
typename Tp, Tp... Idx>
112 static constexpr size_t size() noexcept {
return sizeof...(Idx); }
115template <typename Tp, Tp NumT, typename ISeq = typename Build_index_tuple<NumT>::__type>
118template <
typename Tp, Tp NumT,
size_t... Idx>
121 static_assert(NumT >= 0,
"Cannot make integer sequence of negative length");
127template <
typename Tp, Tp NumT>
131template <
size_t... Idx>
135template <
size_t NumT>
139template <
typename... Types>
142template <
size_t Idx,
typename Tup>
145template <
typename FnT,
typename TupleT,
size_t... Idx>
148 ->
decltype(std::forward<FnT>(__f)(std::get<Idx>(__t)...))
150 return std::forward<FnT>(__f)(std::get<Idx>(__t)...);
160template <
size_t... Idx>
164template <
size_t NumT>
168template <
typename... Types>
171template <
typename FnT,
typename TupleT>
173apply(FnT&& __f, TupleT&& __t)
175 constexpr auto N = std::tuple_size<TupleT>::value;
176 impl::apply(std::forward<FnT>(__f), std::forward<TupleT>(__t),
188static const short STARTED = 0;
189static const short PARTIAL = 1;
190static const short STOPPED = 2;
191static const short NONINIT = 3;
typename Make_integer_sequence< Tp, NumT >::__type make_integer_sequence
Alias template make_integer_sequence.
make_integer_sequence< size_t, NumT > make_index_sequence
Alias template make_index_sequence.
decay_t< decltype(std::get< Idx >(std::declval< Tup >()))> index_type_t
make_index_sequence< sizeof...(Types)> index_sequence_for
Alias template index_sequence_for.
void consume_parameters(Args &&...)
impl::make_integer_sequence< size_t, NumT > make_index_sequence
Alias template make_index_sequence.
impl::make_index_sequence< sizeof...(Types)> index_sequence_for
Alias template index_sequence_for.
typename std::decay< T >::type decay_t
typename std::enable_if< B, T >::type enable_if_t
integer_sequence< Tp, static_cast< Tp >(Idx)... > __type
Class template integer_sequence.
static constexpr size_t size() noexcept