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 ()

Given:

     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).

Glen

--
View this message in context: http://boost.2283326.n4.nabble.com/Root-Pointer-Benchmark-tp4684533p4684560.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

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