what about if I have more than one memory mapped file and multiple such vectors in separate memory mapped io areas?

I think the method you're suggesting uses global variables, doesn't it

No. I'm thinking about templating the allocator with a make_-style function that reutnrs an object of type T and then copying its value into the object that you're allocating. So somewhere in the allocator you'd have:

new T(make_func())

This also won't result in the copy that it might seem to require. Most (all?) compilers will optimize it out.

Andrew Sutton
andrew.n.sutton@gmail.com