Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2008-04-30 03:25:20


Author: danieljames
Date: 2008-04-30 03:25:20 EDT (Wed, 30 Apr 2008)
New Revision: 44918
URL: http://svn.boost.org/trac/boost/changeset/44918

Log:
Change the typedef of buffered functions as it was confusing MSVC 6.5

get_allocator wasn't compiling when the allocator workaround is used because it
couldn't cast from the wrapped allocator to an allocator of another type. So
use value_alloc_ when it's available (it's only unavailable on compilers with
C++0x support, which don't require the workaround).

Text files modified:
   branches/unordered/trunk/boost/unordered/detail/hash_table_impl.hpp | 17 +++++++++++++----
   1 files changed, 13 insertions(+), 4 deletions(-)

Modified: branches/unordered/trunk/boost/unordered/detail/hash_table_impl.hpp
==============================================================================
--- branches/unordered/trunk/boost/unordered/detail/hash_table_impl.hpp (original)
+++ branches/unordered/trunk/boost/unordered/detail/hash_table_impl.hpp 2008-04-30 03:25:20 EDT (Wed, 30 Apr 2008)
@@ -1128,11 +1128,13 @@
         private:
 
 
- typedef boost::unordered_detail::buffered_functions<Hash, Pred> buffered_functions;
- typedef BOOST_DEDUCED_TYPENAME buffered_functions::functions functions;
- typedef BOOST_DEDUCED_TYPENAME buffered_functions::functions_ptr functions_ptr;
+ typedef boost::unordered_detail::buffered_functions<Hash, Pred>
+ function_store;
+ typedef BOOST_DEDUCED_TYPENAME function_store::functions functions;
+ typedef BOOST_DEDUCED_TYPENAME function_store::functions_ptr
+ functions_ptr;
 
- buffered_functions functions_;
+ function_store functions_;
             float mlf_;
             size_type max_load_;
 
@@ -1376,10 +1378,17 @@
             // accessors
 
             // no throw
+#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
             node_allocator get_allocator() const
             {
                 return data_.allocators_.node_alloc_;
             }
+#else
+ value_allocator get_allocator() const
+ {
+ return data_.allocators_.value_alloc_;
+ }
+#endif
 
             // no throw
             hasher const& hash_function() const


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