
5 Oct
2006
5 Oct
'06
5 a.m.
My application also uses a lot of strings (basic_string) and I was seeking some advice on changing the basic_string allocator to a “boost allocator” . Can anyone offer some advice in this regard?
If your allocating lots of small strings as part of processing that are all discarded once done I would consider one of the pool allocators to save time in destructing them all. Alternatively, preallocate them with maximum sizes and make them static which achieves the same effect for repeated processing using the same set of small strings. It depends upon your application so testing is the best approach. regards, Anthony