Top "Allocator" questions

A component of C++'s Standard Library, in charge of handling the requests for allocation and deallocation of memory for a container.

Compelling examples of custom C++ allocators?

What are some really good reasons to ditch std::allocator in favor of a custom solution? Have you run across …

c++ memory-management std memory-alignment allocator
Custom allocator in std::vector

Is it possible to use custom allocator for std::vector internal allocations? If yes, how?

c++ stl c++11 allocator
How is a vector's data aligned?

If I want to process data in a std::vector with SSE, I need 16 byte alignment. How can I achieve …

c++ vector sse memory-alignment allocator
Making std::vector allocate aligned memory

Is it possible to make std::vector of custom structs allocate aligned memory for further processing with SIMD instructions? If …

c++ memory-management memory-alignment allocator
polymorphic_allocator: when and why should I use it?

Here is the documentation on cppreference, here is the working draft. I must admit that I didn't understand what's the …

c++ allocator c++17
Stack-buffer based STL allocator?

I was wondering if it practicable to have an C++ standard library compliant allocator that uses a (fixed sized) buffer …

c++ stl stack allocator
Why is allocator::rebind necessary when we have template template parameters?

Every allocator class must have an interface similar to the following: template<class T> class allocator { ... template<…

c++ templates allocator template-templates
C++ STL allocator vs operator new

According to C++ Primer 4th edition, page 755, there is a note saying: Modern C++ programs ordinarily ought to use the …

c++ memory stl new-operator allocator
c++ Vector, what happens whenever it expands/reallocate on stack?

I'm new to C++ and I'm using the vector class on my project. I found it quite useful because I …

c++ vector stack allocator
How can I write a stateful allocator in C++11, given requirements on copy construction?

As far as I can tell, the requirements on an allocator to be used with STL containers are laid out …

c++ c++11 stl allocator