calls to allocator_traits::construct() and ::destroy() used, this time with valid parameters, C++11 requires raw pointers

[SVN r82966]
This commit is contained in:
Adam Wulkiewicz
2013-02-18 03:37:52 +00:00
parent 9198afb7f9
commit c47f314aaa
2 changed files with 4 additions and 13 deletions

View File

@@ -263,9 +263,7 @@ struct create_dynamic_node
auto_deallocator<AllocNode> deallocator(alloc_node, p);
alloc_node.construct(p, Node(alloc_node));
// TEMPORARILY COMMENTED OUT
//Al::construct(alloc_node, p, alloc_node);
Al::construct(alloc_node, boost::addressof(*p), alloc_node);
deallocator.release();
return p;
@@ -284,9 +282,7 @@ struct destroy_dynamic_node
typedef typename Al::pointer P;
P p(&static_cast<Node&>(rtree::get<Node>(*n)));
alloc_node.destroy(p);
// TEMPORARILY COMMENTED OUT
//Al::destroy(alloc_node, p);
Al::destroy(alloc_node, boost::addressof(*p));
Al::deallocate(alloc_node, p, 1);
}
};

View File

@@ -160,9 +160,7 @@ struct create_static_node
auto_deallocator<AllocNode> deallocator(alloc_node, p);
alloc_node.construct(p, Node(alloc_node));
// TEMPORARILY COMMENTED OUT
//Al::construct(alloc_node, p, Node(alloc_node)); // implicit cast to Variant
Al::construct(alloc_node, boost::addressof(*p), Node(alloc_node)); // implicit cast to Variant
deallocator.release();
return p;
@@ -178,11 +176,8 @@ struct destroy_static_node
static inline void apply(AllocNode & alloc_node, VariantPtr n)
{
typedef boost::container::allocator_traits<AllocNode> Al;
typedef typename Al::pointer P;
alloc_node.destroy(n);
// TEMPORARILY COMMENTED OUT
//Al::destroy(alloc_node, n);
Al::destroy(alloc_node, boost::addressof(*n));
Al::deallocate(alloc_node, n, 1);
}
};