Boost logo

Boost Users :

Subject: Re: [Boost-users] std::vector and default constructor
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2008-11-21 18:20:23


>
> 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_[hidden]



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net