Template Function librapid::detail::safeDeallocate#

Function Documentation#

template<typename T>
void librapid::detail::safeDeallocate(T *ptr, size_t size)#

Safely deallocate memory for size elements, using an std::allocator alloc. If the object cannot be trivially destroyed, the destructor will be called on each element of the data, ensuring that it is safe to free the allocated memory.

Template Parameters

A – The allocator type

Parameters
  • alloc – The allocator object

  • ptr – The pointer to free

  • size – The number of elements of type in the memory block