1 #ifndef FWCore_Utilities_zero_allocator_h
2 #define FWCore_Utilities_zero_allocator_h
19 #include "oneapi/tbb/tbb_allocator.h"
29 template <
typename T,
template <
typename X>
class Allocator = oneapi::tbb::tbb_allocator>
44 T *
allocate(
const std::size_t
n,
const void *hint =
nullptr) {
46 T *ptr = base_allocator_type::allocate(n);
47 std::memset(static_cast<void *>(ptr), 0, n *
sizeof(
value_type));
52 template <
typename T1,
template <
typename X1>
class B1,
typename T2,
template <
typename X2>
class B2>
54 return static_cast<B1<T1>
>(
a) ==
static_cast<B2<T2>
>(b);
56 template <
typename T1,
template <
typename X1>
class B1,
typename T2,
template <
typename X2>
class B2>
58 return static_cast<B1<T1>
>(
a) !=
static_cast<B2<T2>
>(b);
constexpr bool operator==(ELseverityLevel const &e1, ELseverityLevel const &e2) noexcept
zero_allocator(const zero_allocator< U > &a)
Allocator< T > base_allocator_type
constexpr bool operator!=(ELseverityLevel const &e1, ELseverityLevel const &e2) noexcept
zero_allocator< U, Allocator > other
zero_allocator(const zero_allocator &a)
T * allocate(const std::size_t n, const void *hint=nullptr)