Template Function librapid::detail::safeAllocate#

Function Documentation#

template<typename T>
T *librapid::detail::safeAllocate(size_t size)#

Safely allocate memory for size elements using the allocator alloc. 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

safeDeallocate

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