Index: allocators/detail/allocator_common.hpp =================================================================== --- allocators/detail/allocator_common.hpp (revision 62067) +++ allocators/detail/allocator_common.hpp (working copy) @@ -290,6 +290,13 @@ //Deallocate all new linked list at once mp_node_pool->deallocate_nodes(boost::interprocess::move(chain)); } + +public: + void swap(cache_impl &other) { + detail::do_swap(mp_node_pool, other.mp_node_pool); + m_cached_nodes.swap(other.m_cached_nodes); + detail::do_swap(m_max_cached_nodes, other.m_max_cached_nodes); + } }; template @@ -657,9 +664,7 @@ //!different shared memory segments, the result is undefined. friend void swap(cached_allocator_impl &alloc1, cached_allocator_impl &alloc2) { - detail::do_swap(alloc1.mp_node_pool, alloc2.mp_node_pool); - alloc1.m_cached_nodes.swap(alloc2.m_cached_nodes); - detail::do_swap(alloc1.m_max_cached_nodes, alloc2.m_max_cached_nodes); + alloc1.m_cache.swap(alloc2.m_cache); } void deallocate_cache() Index: containers/container/detail/adaptive_node_pool_impl.hpp =================================================================== --- containers/container/detail/adaptive_node_pool_impl.hpp (revision 62067) +++ containers/container/detail/adaptive_node_pool_impl.hpp (working copy) @@ -69,6 +69,11 @@ const bool is_equal = l.free_nodes.size() == r.free_nodes.size(); return is_less || (is_equal && (&l < &r)); } + + friend bool operator ==(const block_info_t &l, const block_info_t &r) { + return &l == &r; + } + }; typedef typename bi::make_multiset >::type block_multiset_t;