18 inline namespace _V1 {
21 template <
typename... T>
struct tuple;
23 template <
typename T,
typename... Ts, std::size_t... Is>
25 const std::index_sequence<Is...> &) {
26 return std::tuple<Ts...>(std::get<Is + 1>(Tuple)...);
29 template <
typename T,
typename... Ts>
32 Tuple, std::make_index_sequence<
sizeof...(Ts)>());
36 return sycl::detail::tuple<Ts...>{Args...};
39 template <
typename... Ts>
auto tie(Ts &...Args) {
40 return sycl::detail::tuple<Ts &...>(Args...);
45 template <std::size_t N,
typename T,
typename... Rest>
49 template <
typename T,
typename... Rest>
54 template <std::
size_t I,
class T>
58 template <
size_t N>
struct get {
59 template <
typename... Ts>
62 return get<N - 1>()(Tuple.next);
65 template <
typename... Ts>
68 return get<N - 1>()(Tuple.next);
74 template <>
struct get<0> {
75 template <
typename... Ts>
78 template <
typename... Ts>
80 return Tuple.holder.value;
83 template <
typename... Ts>
84 constexpr ret_type<Ts...>
const &
86 return Tuple.holder.value;
98 bool = std::is_trivially_copy_assignable_v<TupleValueHolder<T>>>
103 template <
typename T>
114 template <
typename T,
typename... Ts>
struct tuple<T, Ts...> {
122 template <
typename UT,
typename... UTs>
124 : holder(RHS.holder.value), next(RHS.next) {}
126 tuple(
const T &Value,
const Ts &...Next) : holder(Value), next(Next...) {}
129 tuple(
const std::tuple<T, Ts...> &RHS)
133 operator std::tuple<T, Ts...>()
const {
134 return to_std_tuple(*
this, std::make_index_sequence<
sizeof...(Ts) + 1>());
138 template <
typename UT,
typename... UTs>
139 operator std::tuple<UT, UTs...>()
const {
140 return to_std_tuple(
static_cast<tuple<UT, UTs...
>>(*
this),
141 std::make_index_sequence<
sizeof...(Ts) + 1>());
144 template <
typename UT,
typename... UTs>
146 holder.
value = RHS.holder.value;
157 template <
typename UT,
typename... UTs>
159 holder.
value = std::get<0>(RHS);
165 return LHS.holder.value == RHS.holder.value && LHS.next == RHS.next;
168 return !(LHS == RHS);
171 template <
typename UT,
typename... UTs, std::size_t... Is>
173 std::index_sequence<Is...>) {
174 return std::tuple<UT, UTs...>(
get<Is>()(Tuple)...);
196 template <
size_t I,
typename... Types>
197 constexpr
typename tuple_element<I, tuple<Types...>>::type &
199 return sycl::detail::get<I>()(Arg);
202 template <
size_t I,
typename... Types>
203 constexpr
typename tuple_element<I, tuple<Types...>>::type
const &
205 return sycl::detail::get<I>()(Arg);
constexpr tuple_element< I, tuple< Types... > >::type & get(sycl::detail::tuple< Types... > &Arg) noexcept
std::tuple< Ts... > get_tuple_tail(const std::tuple< T, Ts... > &Tuple)
std::tuple< Ts... > get_tuple_tail_impl(const std::tuple< T, Ts... > &Tuple, const std::index_sequence< Is... > &)
constexpr tuple< Ts... > make_tuple(Ts... Args)
typename tuple_element< I, T >::type tuple_element_t
_Abi const simd< _Tp, _Abi > & noexcept
TupleCopyAssignableValueHolder & operator=(const TupleCopyAssignableValueHolder &RHS)
TupleValueHolder()=default
TupleValueHolder(const T &Value)
typename tuple_element< 0, tuple< Ts... > >::type ret_type
constexpr ret_type< Ts... > const & operator()(const tuple< Ts... > &Tuple) const noexcept
constexpr ret_type< Ts... > & operator()(tuple< Ts... > &Tuple) const noexcept
constexpr auto operator()(const tuple< Ts... > &Tuple) const -> decltype(get< N - 1 >()(Tuple.next))
constexpr auto operator()(tuple< Ts... > &Tuple) const -> decltype(get< N - 1 >()(Tuple.next))
tuple & operator=(const detail::tuple< T, Ts... > &)=default
TupleCopyAssignableValueHolder< T > holder
std::tuple< T, Ts... > tuple_type
friend bool operator==(const tuple &LHS, const tuple &RHS)
static std::tuple< UT, UTs... > to_std_tuple(const tuple< UT, UTs... > &Tuple, std::index_sequence< Is... >)
tuple(const std::tuple< T, Ts... > &RHS)
tuple(const tuple &)=default
tuple & operator=(const detail::tuple< UT, UTs... > &RHS)
tuple(const tuple< UT, UTs... > &RHS)
tuple & operator=(const std::tuple< UT, UTs... > &RHS)
friend bool operator!=(const tuple &LHS, const tuple &RHS)
tuple(const T &Value, const Ts &...Next)
tuple & operator=(const tuple &)=default
tuple(const std::tuple<> &)
friend bool operator==(const tuple &, const tuple &)
tuple(const tuple &)=default
tuple & operator=(const std::tuple<> &)