CbmRoot
Loading...
Searching...
No Matches
PODVector.h
Go to the documentation of this file.
1/* Copyright (C) 2022 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Felix Weiglhofer [committer] */
4#ifndef CBM_ALGO_BASE_POD_VECTOR_H
5#define CBM_ALGO_BASE_POD_VECTOR_H
6
7#include "util/PODAllocator.h"
8
9#include <vector>
10
11namespace cbm::algo
12{
16 template<class T>
17 using PODVector = std::vector<T, PODAllocator<T>>;
18
19 template<typename T>
20 std::vector<T> ToStdVector(const PODVector<T>& vec)
21 {
22 return std::vector<T>(vec.begin(), vec.end());
23 }
24
25 template<typename T>
26 PODVector<T> ToPODVector(const std::vector<T>& vec)
27 {
28 return PODVector<T>(vec.begin(), vec.end());
29 }
30
31} // namespace cbm::algo
32
33#endif // CBM_ALGO_BASE_POD_VECTOR_H
std::vector< T, PODAllocator< T > > PODVector
PODVector is a std::vector that doesn't initialize its elements.
Definition PODVector.h:17
std::vector< T > ToStdVector(const PODVector< T > &vec)
Definition PODVector.h:20
PODVector< T > ToPODVector(const std::vector< T > &vec)
Definition PODVector.h:26