12#include "vecmem/utils/types.hpp"
21template <
typename T, std::
size_t N>
29 throw std::out_of_range(
"Index greater than size of static array.");
35template <
typename T, std::
size_t N>
43 throw std::out_of_range(
"Index greater than size of static array.");
49template <
typename T, std::
size_t N>
59template <
typename T, std::
size_t N>
68template <
typename T, std::
size_t N>
69template <std::size_t
I,
70 std::enable_if_t<I<N, bool> > VECMEM_HOST_AND_DEVICE
constexpr auto
76template <
typename T, std::
size_t N>
77template <std::size_t
I,
78 std::enable_if_t<I<N, bool> > VECMEM_HOST_AND_DEVICE
constexpr auto
84template <
typename T, std::
size_t N>
85VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::front(
void)
93template <
typename T, std::
size_t N>
94VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::front(
void)
const
102template <
typename T, std::
size_t N>
103VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::back(
void)
111template <
typename T, std::
size_t N>
112VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::back(
void)
const
120template <
typename T, std::
size_t N>
121VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::data(
void)
129template <
typename T, std::
size_t N>
130VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::data(
void)
const
138template <
typename T, std::
size_t N>
139VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::begin() -> iterator {
144template <
typename T, std::
size_t N>
145VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::begin()
const
151template <
typename T, std::
size_t N>
152VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::cbegin()
const
158template <
typename T, std::
size_t N>
159VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::end() -> iterator {
164template <
typename T, std::
size_t N>
165VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::end()
const
171template <
typename T, std::
size_t N>
172VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::cend()
const
178template <
typename T, std::
size_t N>
179VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::rbegin()
180 -> reverse_iterator {
182 return reverse_iterator(end());
185template <
typename T, std::
size_t N>
186VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::rbegin()
const
187 -> const_reverse_iterator {
189 return const_reverse_iterator(end());
192template <
typename T, std::
size_t N>
193VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::crbegin()
const
194 -> const_reverse_iterator {
199template <
typename T, std::
size_t N>
200VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::rend()
201 -> reverse_iterator {
203 return reverse_iterator(begin());
206template <
typename T, std::
size_t N>
207VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::rend()
const
208 -> const_reverse_iterator {
210 return const_reverse_iterator(begin());
213template <
typename T, std::
size_t N>
214VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::crend()
const
215 -> const_reverse_iterator {
220template <
typename T, std::
size_t N>
221VECMEM_HOST_AND_DEVICE
constexpr bool static_array<T, N>::empty()
const {
226template <
typename T, std::
size_t N>
227VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::size()
const
233template <
typename T, std::
size_t N>
234VECMEM_HOST_AND_DEVICE
constexpr auto static_array<T, N>::max_size()
const
240template <
typename T, std::
size_t N>
241VECMEM_HOST_AND_DEVICE
void static_array<T, N>::fill(const_reference value) {
243 for (std::size_t
i = 0;
i <
N; ++
i) {
248template <
typename T, std::
size_t N>
268template <
typename T, std::
size_t N>
288template <std::size_t
I,
class T, std::size_t
N,
289 std::enable_if_t<I<N, bool> > VECMEM_HOST_AND_DEVICE
constexpr T&
get(
296 std::size_t
I,
class T, std::size_t
N,
297 std::enable_if_t<I<N, bool> > VECMEM_HOST_AND_DEVICE
constexpr const T&
get(
Main namespace for the vecmem classes/functions.
Definition atomic_ref.hpp:16
VECMEM_HOST_AND_DEVICE bool operator!=(const static_array< T, N > &lhs, const static_array< T, N > &rhs)
Non-equality check on two arrays.
Definition static_array.ipp:269
VECMEM_HOST_AND_DEVICE bool operator==(const static_array< T, N > &lhs, const static_array< T, N > &rhs)
Equality check on two arrays.
Definition static_array.ipp:249
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
Simple statically-sized array-like class designed for use in device code.
Definition static_array.hpp:33
value_type & reference
Value reference type.
Definition static_array.hpp:46
const value_type & const_reference
Constant value reference type.
Definition static_array.hpp:48
VECMEM_HOST_AND_DEVICE constexpr reference operator[](size_type i)
Accessor method.
Definition static_array.ipp:50
std::size_t size_type
Size type for the array.
Definition static_array.hpp:41
VECMEM_HOST constexpr reference at(size_type i)
Bounds-checked accessor method.
Definition static_array.ipp:22