Project
Loading...
Searching...
No Matches
vecpod.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef QONMODULE_VECPOD_H
16#define QONMODULE_VECPOD_H
17
18#include <vector>
19
20template <class T>
22 typedef T value_type;
23 vecpod_allocator() noexcept : stdalloc() {}
24 T* allocate(std::size_t n) { return stdalloc.allocate(n); }
25 void deallocate(T* p, std::size_t n) { stdalloc.deallocate(p, n); }
26 static void construct(T*) {}
27 std::allocator<T> stdalloc;
28};
29
30template <class T>
31using vecpod = typename std::vector<T, vecpod_allocator<T>>;
32// template <class T> using vecpod = typename std::vector<T>;
33
34#endif // QONMODULE_VECPOD_H
GLdouble n
Definition glcorearb.h:1982
T * allocate(std::size_t n)
Definition vecpod.h:24
void deallocate(T *p, std::size_t n)
Definition vecpod.h:25
static void construct(T *)
Definition vecpod.h:26
std::allocator< T > stdalloc
Definition vecpod.h:27
vecpod_allocator() noexcept
Definition vecpod.h:23
typename std::vector< T, vecpod_allocator< T > > vecpod
Definition vecpod.h:31