
16 Jun
2009
16 Jun
'09
3:45 a.m.
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.