Namespaces
Variants
Actions

std::experimental::pmr::polymorphic_allocator<T>::allocate

From cppreference.com
 
C++
 
Library fundamentals
 
Polymorphic allocator library
 
std::experimental::pmr::polymorphic_allocator
T* allocate( std::size_t n );
(library fundamentals TS)

Allocates storage for n objects of type T using the underlying memory resource. Equivalent to

return static_cast<T*>(this->resource()->allocate(n * sizeof(T), alignof(T));.

[edit] Parameters

n - the number of objects to allocate storage for

[edit] Return value

A pointer to the allocated storage.

[edit] See also

[static]
allocates uninitialized storage using the allocator
(public static member function of std::allocator_traits<Alloc>) [edit]
deallocates memory
(public member function of std::experimental::pmr::memory_resource) [edit]

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant