Boost logo

Boost-Commit :

From: xushiweizh_at_[hidden]
Date: 2008-06-13 13:58:17


Author: xushiwei
Date: 2008-06-13 13:58:17 EDT (Fri, 13 Jun 2008)
New Revision: 46377
URL: http://svn.boost.org/trac/boost/changeset/46377

Log:
alloc_type& stl_allocator::get_alloc()
Text files modified:
   sandbox/memory/boost/memory.hpp | 6 ++++--
   1 files changed, 4 insertions(+), 2 deletions(-)

Modified: sandbox/memory/boost/memory.hpp
==============================================================================
--- sandbox/memory/boost/memory.hpp (original)
+++ sandbox/memory/boost/memory.hpp 2008-06-13 13:58:17 EDT (Fri, 13 Jun 2008)
@@ -85,7 +85,7 @@
         stl_allocator(AllocT& alloc) : m_alloc(&alloc) {}
 
     template <class U>
- stl_allocator(const stl_allocator<U, AllocT>& o) : m_alloc(o._getAlloc()) {}
+ stl_allocator(const stl_allocator<U, AllocT>& o) : m_alloc(&o.get_alloc()) {}
 
         pointer allocate(size_type count, const void* = NULL)
                 { return (pointer)m_alloc->allocate(count * sizeof(Type)); }
@@ -101,7 +101,9 @@
                 { return (char*)m_alloc->allocate(cb); }
 
 public:
- AllocT* _getAlloc() const { return m_alloc; }
+ typedef AllocT alloc_type;
+
+ AllocT& get_alloc() const { return *m_alloc; }
 };
 
 #if !defined(BOOST_MEMORY_NO_PARTIAL_SPECIAILIZATION)


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