Boost logo

Boost :

Subject: Re: [boost] [Root Pointer] Benchmark
From: Glen Fernandes (glen.fernandes_at_[hidden])
Date: 2016-03-14 09:11:10

On Mar 14, 2016; 8:06am, Phil Bouchard wrote:
> Indeed, I need to add a way to pass a1 in the constructor.

Yes, but in addition to that, the concern is:

> Yes because I use: node<int, small_object_allocator&lt;int> >::operator
> new ()


     new block<int, small_object_allocator&lt;int> >(/* a1 */)

I still don't see how the 'new block<T, A>(...)' is going to use 'a1' for
the block<T, A> allocation.

I can see how it could not use '::operator new(std::size_t)' if you have
overloaded operator new for block<T, A>, but at that point, you still
wouldn't know 'a1' (though you do know the type 'A').

Just using A{}.allocate(...) is not sufficient, especially if A is a
stateful allocator. i.e. A might not even be default-constructible: the only
way to construct an A instance might require providing that state (a1) (or
copy-construct given an existing A instance).


View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at