|
Boost : |
Subject: Re: [boost] [Root Pointer] Benchmark
From: Phil Bouchard (philippeb8_at_[hidden])
Date: 2016-03-15 22:50:55
On 03/15/2016 09:57 PM, Phil Bouchard wrote:
>
> I'm still working on it but right now I have already simplified the
> syntax, by adding a wrapper function, to:
>
> int main()
> {
> int n1 = 0, m1 = 0;
> int n2 = 0, m2 = 0;
> {
> typedef boost::node<U, Allocator<U> > node;
>
> boost::root_ptr<U> p1, p2, p3;
>
> node::allocator_type a1(n1, m1);
> node::allocator_type a2(n2, m2);
> node::allocator_type a3(n2, m2);
>
> p1 = node::allocate(a1, 1, 'a');
> p2 = node::allocate(a2, 2, 'b');
> p3 = node::allocate(a3, 3, 'c');
>
> if (n1 != 1 || m1 != 1 || n2 != 2 || m2 != 2) {
> throw 3;
> }
> }
> if (n1 != 0 || m1 != 0 || n2 != 0 || m2 != 0) {
> throw 4;
> }
> }
Ok sorry for the delay but it's fixed now:
int main()
{
int n1 = 0, m1 = 0;
int n2 = 0, m2 = 0;
{
typedef boost::node<U, Allocator<U> > node;
boost::root_ptr<U> p1;
boost::root_ptr<U> p2;
boost::root_ptr<U> p3;
p1 = node::allocate(node::allocator_type(n1, m1), 1, 'a');
p2 = node::allocate(node::allocator_type(n2, m2), 2, 'b');
p3 = node::allocate(node::allocator_type(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;
}
}
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk