Memory Allocation for a Map with a fixed number of insertions

Posted by prasoon99 on Stack Overflow See other posts from Stack Overflow or by prasoon99
Published on 2010-03-27T05:59:48Z Indexed on 2010/03/27 6:03 UTC
Read the original article Hit count: 245

Filed under:
|
|
|
|

I want to insert n elements into a map where n is known ahead of time. I do not want memory allocation at each insertion. I want all memory allocation at the beginning. Is there a way to do this? If so, how? Will writing some sort of memory allocator help?

© Stack Overflow or respective owner

Related posts about stl

Related posts about map