logoalt Hacker News

lefratoday at 3:47 PM1 replyview on HN

I never used it in practice, so maybe the support isn't that good, but I was under the impression that it was possible to pass custom allocators basically everywhere in the STL. See for example the definition of a vector here:

https://en.cppreference.com/cpp/container/vector


Replies

kllrnohjtoday at 4:09 PM

std::allocator was so painful to use it was almost always easier to just reimplement the container instead (especially for trivial ones like vector).

I haven't used the relatively new C++17 polymorphic_allocator, though, maybe it fixes this.