22 typedef typename _Node_::_Base_ptr _Base_ptr;
23 typedef _Alloc allocator_type;
25 _Alloc_base(allocator_type
const& __A)
26 : _M_node_allocator(__A) {}
31 return _M_node_allocator;
41 NoLeakAlloc(_Alloc_base * b) : base(b), new_node(base->_M_allocate_node()) {}
43 _Node_ * get() {
return new_node; }
44 void disconnect() { new_node = NULL; }
46 ~NoLeakAlloc() {
if (new_node) base->_M_deallocate_node(new_node); }
51 allocator_type _M_node_allocator;
56 return _M_node_allocator.allocate(1);
60 _M_deallocate_node(_Node_*
const __P)
62 return _M_node_allocator.deallocate(__P, 1);
66 _M_construct_node(_Node_* __p, _Tp
const __V = _Tp(),
67 _Base_ptr
const __PARENT = NULL,
68 _Base_ptr
const __LEFT = NULL,
69 _Base_ptr
const __RIGHT = NULL)
71 new (__p) _Node_(__V, __PARENT, __LEFT, __RIGHT);
75 _M_destroy_node(_Node_* __p)
77 _M_node_allocator.destroy(__p);