forked from boostorg/unordered
Refactor node_handle's clear() member function to reset()
This commit is contained in:
@ -86,7 +86,7 @@ struct node_handle_base
|
||||
x.p=nullptr;
|
||||
}
|
||||
|
||||
void clear()
|
||||
void reset()
|
||||
{
|
||||
al().~Allocator();
|
||||
p_=nullptr;
|
||||
@ -99,7 +99,7 @@ struct node_handle_base
|
||||
{
|
||||
if (!nh.empty()){
|
||||
emplace(nh.p_,nh.al());
|
||||
nh.clear();
|
||||
nh.reset();
|
||||
}
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ struct node_handle_base
|
||||
{
|
||||
if(!empty()){
|
||||
type_policy::destroy(al(),p_);
|
||||
a_.t_.~Allocator();
|
||||
reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -403,11 +403,11 @@ namespace boost {
|
||||
BOOST_ASSERT(get_allocator() == nh.get_allocator());
|
||||
|
||||
typename map_types::element_type x;
|
||||
x.p=std::addressof(nh.element());
|
||||
x.p = std::addressof(nh.element());
|
||||
|
||||
auto itp = table_.insert(std::move(x));
|
||||
if (itp.second) {
|
||||
nh.clear();
|
||||
nh.reset();
|
||||
return {itp.first, true, node_type{}};
|
||||
} else {
|
||||
return {itp.first, false, std::move(nh)};
|
||||
|
@ -395,7 +395,7 @@ namespace boost {
|
||||
|
||||
auto itp = table_.insert(std::move(x));
|
||||
if (itp.second) {
|
||||
nh.clear();
|
||||
nh.reset();
|
||||
return {itp.first, true, node_type{}};
|
||||
} else {
|
||||
return {itp.first, false, std::move(nh)};
|
||||
|
Reference in New Issue
Block a user