vecmem 1.14.0
Loading...
Searching...
No Matches
resize_jagged_vector.hpp
1/* VecMem project, part of the ACTS project (R&D line)
2 *
3 * (c) 2023 CERN for the benefit of the ACTS project
4 *
5 * Mozilla Public License Version 2.0
6 */
7#pragma once
8
9// Local include(s).
10#include "vecmem/containers/jagged_vector.hpp"
11#include "vecmem/containers/vector.hpp"
12
13namespace vecmem::details {
14
22template <typename T, typename ALLOC1, typename ALLOC2>
23void resize_jagged_vector(std::vector<std::vector<T, ALLOC1>, ALLOC2>& vec,
24 std::size_t size) {
25 vec.resize(size);
26}
27
36template <typename T>
37void resize_jagged_vector(jagged_vector<T>& vec, std::size_t size) {
38 vec.resize(size, vecmem::vector<T>(vec.get_allocator().resource()));
39}
40
41} // namespace vecmem::details
Namespace for types that should not be used directly by clients.
Definition array.hpp:23
void resize_jagged_vector(std::vector< std::vector< T, ALLOC1 >, ALLOC2 > &vec, std::size_t size)
Resize a generic jagged vector.
Definition resize_jagged_vector.hpp:23
std::vector< T, vecmem::polymorphic_allocator< T > > vector
Alias type for vectors with our polymorphic allocator.
Definition vector.hpp:35