|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r54027 - sandbox/monotonic/boost/monotonic
From: christian.schladetsch_at_[hidden]
Date: 2009-06-17 18:28:07
Author: cschladetsch
Date: 2009-06-17 18:28:07 EDT (Wed, 17 Jun 2009)
New Revision: 54027
URL: http://svn.boost.org/trac/boost/changeset/54027
Log:
added monotonic::shared_allocator
Text files modified:
sandbox/monotonic/boost/monotonic/shared_allocator.hpp | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
Modified: sandbox/monotonic/boost/monotonic/shared_allocator.hpp
==============================================================================
--- sandbox/monotonic/boost/monotonic/shared_allocator.hpp (original)
+++ sandbox/monotonic/boost/monotonic/shared_allocator.hpp 2009-06-17 18:28:07 EDT (Wed, 17 Jun 2009)
@@ -23,25 +23,32 @@
template <class T>
struct shared_allocator : allocator<T>
{
+ typedef allocator<T> Parent;
+
shared_allocator() throw()
- : storage(&static_shared_storage)
+ : Parent(&static_shared_storage)
{
}
shared_allocator(shared_storage_base &store) throw()
- : storage(&store)
+ : Parent(&store)
{
}
shared_allocator(const shared_allocator& alloc) throw()
- : storage(alloc.get_storage())
+ : Parent(alloc.get_storage())
{
}
template <class U>
shared_allocator(const shared_allocator<U> &alloc) throw()
- : storage(alloc.get_storage())
+ : Parent(alloc.get_storage())
+ {
+ }
+
+ shared_storage_base *get_storage() const
{
+ return static_cast<shared_storage_base *>(alloc.get_storage());
}
};
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk