Standard C++17 includes the new pmr namespace, which includes a set of classes grouped under the name memory_resource .
After searching the Internet, I found very little vulgarized information about this, a direct consequence of this question is:
What are the main ideas of pmr and especially pmr::memory_resource ?
Specializing a little more, some question marks in my head:
- What will it bring new, or what were the restrictions that it allows?
- What is the difference with
allocator ? - Does polymorphism mean that you can choose the
allocator runtime provided to the container constructor? (e.g. for testing purposes) - Does this help implement a memory pool or other memory management schemes?
Context:
In order to create a memory pool allocator, I found information about this namespace. Reading names like pool_options or polymorphic_allocator got my attention.
Related questions:
polymorphic_allocator: when and why should I use it?
NOTE. Related questions do not imply any implicit duplication requirement.
c ++ allocator c ++ 17
Adrian maire
source share