Fix the double-destroy of the top node in skew_heap (you can see the destructor being called and then called again).
In the second commit:
For allocate(n) and deallocate(p, n) call them directly. Every allocator is required to provide them. Only allocate(n, hint) needs special handling (e.g. using allocator_traits<A>::allocate(a, n, hint) or boost::allocator_allocate(a, n, hint).
For construction and destruction because you're constructing nodes not value_type, use placement new. For something like std::list<T> you'll see that the node types are not constructed using the allocator, but instead the T inside the node is constructed using the allocator.
Use the allocator access utilities instead of having #ifdef BOOST_NO_CXX11_ALLOCATOR blocks everywhere.
@timblechmann the changes are:
top
node in skew_heap (you can see the destructor being called and then called again).allocate(n)
anddeallocate(p, n)
call them directly. Every allocator is required to provide them. Onlyallocate(n, hint)
needs special handling (e.g. usingallocator_traits<A>::allocate(a, n, hint)
orboost::allocator_allocate(a, n, hint)
.value_type
, use placement new. For something likestd::list<T>
you'll see that the node types are not constructed using the allocator, but instead theT
inside the node is constructed using the allocator.#ifdef BOOST_NO_CXX11_ALLOCATOR
blocks everywhere.