|
Boost : |
Subject: Re: [boost] Proposal: Monotonic Containers
From: Christian Schladetsch (christian.schladetsch_at_[hidden])
Date: 2009-06-15 23:45:14
For completeness, I have added monotonic::shared_storage<>
http://tinyurl.com/m7hyap
This is not tested. However, it simply puts a mutex guard around all
pertinent methods that are passed through to a private storage.
Note that you do not need shared_storage and pay for the mutex locks if your
containers are on the stack.
So, now you have stack-based storage for any container or number of
containers if you wish, which will then transparently use the heap as
required without invalidating containers that have some of their data on the
stack.
It is also thread-safe, either by guaranteeing data is on the stack using
fixed_storage<N>, or by using shared_storage<>.
Christian.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk