Boost logo

Boost :

From: Daniel James (daniel_at_[hidden])
Date: 2005-01-22 13:08:32


Hi,

I'm using the multi-index allocator utilities for the unordered
associative containers implementation. Because
partial_std_allocator_wrapper can't be constructed from the standard
allocator, I get an error when I use a standard allocator as a
constructor parameter. I believe it also prevents this with the
multi-index library.

Would it be possible to apply the attached patch to fix this? (Or is
there another way?) I added an implicit constructor, although an
explicit one would be fine for my use.

thanks,

Daniel

Index: allocator_utilities.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/detail/allocator_utilities.hpp,v
retrieving revision 1.5
diff -u -r1.5 allocator_utilities.hpp
--- allocator_utilities.hpp 13 Dec 2004 07:17:17 -0000 1.5
+++ allocator_utilities.hpp 22 Jan 2005 18:03:44 -0000
@@ -42,6 +42,11 @@
   template<typename Other>
   partial_std_allocator_wrapper(const partial_std_allocator_wrapper<Other>&){}
 
+ partial_std_allocator_wrapper(std::allocator<Type> const& x)
+ : std::allocator<Type>(x)
+ {
+ };
+
 #if defined(BOOST_DINKUMWARE_STDLIB)
   /* Dinkumware guys didn't provide a means to call allocate() without
    * supplying a hint, in disagreement with the standard.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk