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 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
(n1, m1), 1, 'a'); p2 = boost::allocate_node<U>(boost::make_node_allocator (n2, m2), 2, 'b'); p3 = boost::allocate_node<U>(boost::make_node_allocator (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.