Template Function librapid::detail::safeAllocate#
Defined in File storage.hpp
Function Documentation#
-
template<typename T>
T *librapid::detail::safeAllocate(size_t size)# Safely allocate memory for
size
elements using the allocatoralloc
. If the data can be trivially default constructed, then the constructor is not called and no data is initialized. Otherwise, the correct default constructor will be called for each element in the data, making sure the returned pointer is safe to use.See also
- Template Parameters
A – The allocator type to use
- Parameters
alloc – The allocator object to use
size – Number of elements to allocate
- Returns
Pointer to the first element