Boost logo

Boost :

Subject: Re: [boost] [Root Pointer] Benchmark
From: Phil Bouchard (philippeb8_at_[hidden])
Date: 2016-03-17 18:49:54


On 03/16/2016 05:35 PM, Phil Bouchard wrote:
>
> I have simplified it and now it cannot be any simpler than the following
> (using template template argument):
>
> template<class T, class V = float>
> class Allocator
> {
> [...]
>
>
> int main()
> {
> int n1 = 0, m1 = 0;
> int n2 = 0, m2 = 0;
> {
> boost::root_ptr<U> p1, p2, p3;
> p1 =
> boost::allocate_node<U>(boost::make_node_allocator<Allocator, U>(n1,
> m1), 1, 'a');
> p2 =
> boost::allocate_node<U>(boost::make_node_allocator<Allocator, U,
> double>(n2, m2), 2, 'b');
> p3 =
> boost::allocate_node<U>(boost::make_node_allocator<Allocator, U, long
> double>(n2, m2), 3, 'c');
>
> if (n1 != 1 || m1 != 1 || n2 != 2 || m2 != 2) {
> throw 3;
> }
> }
> if (n1 != 0 || m1 != 0 || n2 != 0 || m2 != 0) {
> throw 4;
> }
> }
>
> Or:
> https://github.com/philippeb8/root_ptr/blob/master/example/allocator.cpp#L82

Is that acceptable?

I am working on the neural network right now so I can give it the
ultimate test.


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