Refactor node_handle's clear() member function to reset()

This commit is contained in:
Christian Mazakas committed 2023-02-19 21:26:06 -08:00
1 parent b08810c0c4
commit 5986f75d16
3 files changed
+6 -6

No files matched your search

@@ -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)};