When to Choose Polymorphic Allocators
When to choose the polymorphic allocator model The polymorphic allocator model should be your go-to model when possible. ▪ Easiest to use for both allocator author and consumer. ▪ Allocator author need only derive from std::pmr::memory_resource. ▪ Allocator user does not need to define a template or deal with other complexities of the C++11 allocator system. ▪ Simple way to choose resource at runtime However, use of polymorphic allocators will incur the overhead of a virtual-function call on every allocation and deallocation. ▪ For some applications, this overhead is invisible, but others might see a hit.
A photographed presentation slide explains when to choose the polymorphic allocator model in modern C++. The joke is that the uploader has just learned about allocators, while the slide casually introduces several layers of technical complexity and overhead. This meme is used as a reaction to discovering an intimidating programming topic or unexpectedly dense documentation. EN: A photographed presentation slide explains when to choose the polymorphic allocator model in modern C++. The joke is that the uploader has just learned about allocators, while the slide casually introduces several layers of technical complexity and overhead. This meme is used as a reaction to discovering an intimidating programming topic or unexpectedly dense documentation.
- @ithueti / 836 2019-04-19
- Type
- image
- Size
- 800×427 · 51.1 KiB
- Mood
- sarcastic, relatable
- Language
- en
- Added