Boost logo

Boost :

Subject: Re: [boost] [Root Pointer] Benchmark
From: Phil Bouchard (philippeb8_at_[hidden])
Date: 2016-03-15 23:47:54


On 03/15/2016 11:29 PM, Glen Fernandes wrote:
>
> 1. Your other examples won't compile (e.g. your benchmark.cpp), as you
> have found out, with these changes, for the obvious reason(s) - e.g.
> requiring allocator to provide construct/destroy (which a conforming
> allocator does not have to do in C++11 and above).

I need to see how the containers handle it again.

> 2. You should be rebinding to value_type to construct() the value type
> object (in the same way to you rebind to node type to allocate() node
> type object). Likewise for destroy().

I am not sure I understand this statement correctly.

> 3. Surely:
>
> p1 = node<U, Allocator<U> >::allocate(node<U, Allocator<U>
>> ::allocator_type(x, y), p, q)
>
> can become simpler still. i.e. the target is still something as clean as:
>
> p1 = allocate_shared<U>(Allocator(x, y), p, q);
>
> 4. No 'const_cast'-ing away 'const'. You need to use the allocators correctly.

;) Those are just temporary.

I call it a night.


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