30#include <initializer_list>
35#if !defined(PTL_NO_SANITIZE_THREAD)
37# if defined(__has_attribute)
38# if __has_attribute(no_sanitize)
39# define PTL_NO_SANITIZE_THREAD __attribute__((no_sanitize("thread")))
41# define PTL_NO_SANITIZE_THREAD
43# elif defined(__clang__) || defined(__GNUC__)
44# define PTL_NO_SANITIZE_THREAD __attribute__((no_sanitize("thread")))
47# define PTL_NO_SANITIZE_THREAD
54using decay_t =
typename std::decay<T>::type;
56template <
bool B,
typename T =
void>
69template <
size_t... Indexes>
74template <
typename Itup1,
typename Itup2>
77template <
size_t... Ind1,
size_t... Ind2>
86:
Itup_cat<typename Build_index_tuple<NumT / 2>::__type,
87 typename Build_index_tuple<NumT - NumT / 2>::__type>
103template <
typename Tp, Tp... Idx>
107 static constexpr size_t size() noexcept {
return sizeof...(Idx); }
110template <typename Tp, Tp NumT, typename ISeq = typename Build_index_tuple<NumT>::__type>
113template <
typename Tp, Tp NumT,
size_t... Idx>
116 static_assert(NumT >= 0,
"Cannot make integer sequence of negative length");
122template <
typename Tp, Tp NumT>
126template <
size_t... Idx>
130template <
size_t NumT>
134template <
typename... Types>
137template <
size_t Idx,
typename Tup>
140template <
typename FnT,
typename TupleT,
size_t... Idx>
143 ->
decltype(std::forward<FnT>(_func)(std::get<Idx>(std::move(_args))...))
146#if defined(__GNUC__) && (__GNUC__ < 6)
147 if(
sizeof...(Idx) == 0)
152 return std::forward<FnT>(_func)(std::get<Idx>(std::move(_args))...);
162template <
size_t... Idx>
166template <
size_t NumT>
170template <
typename... Types>
173template <
typename FnT,
typename TupleT>
175apply(FnT&& _func, TupleT&& _args)
177 using tuple_type =
typename std::decay<TupleT>::type;
178 constexpr auto N = std::tuple_size<tuple_type>::value;
179 impl::apply(std::forward<FnT>(_func), std::forward<TupleT>(_args),
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.
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.
void ConsumeParameters(Args &&...)
typename std::decay< T >::type decay_t
typename std::enable_if< B, T >::type enable_if_t
Class template integer_sequence.
static constexpr size_t size() noexcept