lundi 24 août 2015

Modifying growing strategy using custom allocator

I am not a user of custom allocator, but I was wondering whether a custom allocator can be used to redefine the growing strategy. For example, in most implementations, a std::vector grows geometrically. Would it be possible to change this strategy for an arithmetic growth, like adding 10 elements everytime a reallocation is necessary. And if the answer if yes, then how to do that?

Aucun commentaire:

Enregistrer un commentaire