4 ms·
Using a custom allocator with standard collections can be highly useful, as the article points out. I do recommend defining your own container deriving from a
by AdieuToLogic 11y ago
Using a custom allocator with standard collections can be highly useful, as the article points out. I do recommend defining your own container deriving from a type such as std::vector using private inheritance, and exposing the base definitions via the "using" keyword and replicating applicable typedefs/constructors.
Doing so will help prevent "interesting" behaviour and help expose assumptive template definitions in a code base.