Andrew Sutton | 22 Nov 00:20
Picon

Re: std::vector and default constructor

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 <at> gmail.com
_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Gmane