Standard containers by default place their contents on the free store. You can give them an allocator that allocates from some other place.
Printable View
Standard containers by default place their contents on the free store. You can give them an allocator that allocates from some other place.
lol I wished I'd phrased my question that way first! That's all I needed to know really.... thanks very much!
On a side note, it's not possible to write a standard-compliant allocator that allocates from the stack for a standard-compliant container. Not unless you basically take a huge block of stack and then do your own memory management within it.