10#include "vecmem/utils/type_traits.hpp"
11#include "vecmem/utils/types.hpp"
23template <
typename...
Ts>
28 static_assert(
sizeof...(Ts) == 0,
29 "There's a coding error in vecmem::tuple!");
49template <
typename T,
typename...
Ts>
65 vecmem::details::conjunction<
70 : m_head(parent.m_head), m_tail(parent.m_tail) {}
78 typename U,
typename...
Us,
82 std::is_constructible<T, U &&>,
83 std::is_constructible<Ts, Us &&>...>::value,
96 template <
typename U,
typename...
Us,
98 std::is_constructible<T, U &&>,
99 std::is_constructible<Ts, Us &&>...>::value,
113 m_head = parent.m_head;
114 m_tail = parent.m_tail;
122 template <
typename U,
typename...
Us,
123 std::enable_if_t<(
sizeof...(Ts) ==
sizeof...(
Us)) &&
125 std::is_assignable<T, U &&>,
126 std::is_assignable<Ts, Us &&>...>::value,
128 VECMEM_HOST_AND_DEVICE
constexpr tuple &
operator=(
130 m_head = parent.m_head;
131 m_tail = parent.m_tail;
152template <std::size_t
I,
typename...
Ts>
153VECMEM_HOST_AND_DEVICE
inline constexpr const auto &
get(
163template <std::size_t
I,
typename...
Ts>
172template <
typename...
Ts>
181template <
class...
Ts>
190template <std::
size_t I,
class T>
198template <std::size_t
I,
typename...
Ts>
210template <std::
size_t I,
class T>
218#include "vecmem/utils/impl/tuple.ipp"
Main namespace for the vecmem classes/functions.
Definition atomic_ref.hpp:16
VECMEM_HOST_AND_DEVICE constexpr tuple< typename std::decay< Ts >::type... > make_tuple(Ts &&... args)
Make a tuple with automatic type deduction.
Definition tuple.ipp:88
VECMEM_HOST_AND_DEVICE constexpr const auto & get(const tuple< Ts... > &t) noexcept
Get a constant element out of a tuple.
Definition tuple.ipp:58
std::vector< T, vecmem::polymorphic_allocator< T > > vector
Alias type for vectors with our polymorphic allocator.
Definition vector.hpp:35
VECMEM_HOST_AND_DEVICE constexpr tuple< Ts &... > tie(Ts &... args)
Tie references to existing objects, into a tuple.
Definition tuple.ipp:81
typename tuple_element< I, T >::type tuple_element_t
Convenience accessor for the I-th element of a tuple.
Definition tuple.hpp:211
Implementation for std::conjunction.
Definition type_traits.hpp:53
Implementation for std::negation.
Definition type_traits.hpp:91
constexpr tuple(tuple &&) noexcept=default
Default move constructor.
T m_head
The first/head element of the tuple.
Definition tuple.hpp:136
VECMEM_HOST_AND_DEVICE constexpr tuple & operator=(const tuple &parent)
Assignment operator.
Definition tuple.hpp:112
VECMEM_HOST_AND_DEVICE constexpr tuple(U &&head, Us &&... tail)
Main constructor, from a list of tuple elements.
Definition tuple.hpp:85
constexpr tuple()=default
Default constructor.
VECMEM_HOST_AND_DEVICE constexpr tuple(U &&head, tuple< Us... > &&tail)
"Concatenation" constructor
Definition tuple.hpp:101
constexpr tuple(const tuple &)=default
Default copy constructor.
tuple< Ts... > m_tail
The rest of the tuple elements.
Definition tuple.hpp:138
std::decay_t< decltype(get< I >(std::declval< tuple< Ts... > >()))> type
Type of the I-th element of the specified tuple.
Definition tuple.hpp:202
Default/empty implementation for vecmem::tuple_element.
Definition tuple.hpp:191
Default tuple type.
Definition tuple.hpp:24
constexpr tuple()=default
Default constructor for the default tuple type.