forked from boostorg/unordered
Remove node_tmp overload of add_node.
This commit is contained in:
@ -381,14 +381,6 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
pos->group_prev_ = n;
|
pos->group_prev_ = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline iterator add_node(
|
|
||||||
node_tmp& a,
|
|
||||||
std::size_t key_hash,
|
|
||||||
iterator pos)
|
|
||||||
{
|
|
||||||
return add_node(a.release(), key_hash, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline iterator add_node(
|
inline iterator add_node(
|
||||||
node_pointer n,
|
node_pointer n,
|
||||||
std::size_t key_hash,
|
std::size_t key_hash,
|
||||||
@ -442,14 +434,15 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
// reserve has basic exception safety if the hash function
|
// reserve has basic exception safety if the hash function
|
||||||
// throws, strong otherwise.
|
// throws, strong otherwise.
|
||||||
this->reserve_for_insert(this->size_ + 1);
|
this->reserve_for_insert(this->size_ + 1);
|
||||||
return this->add_node(a, key_hash, position);
|
return this->add_node(a.release(), key_hash, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
void emplace_impl_no_rehash(node_tmp& a)
|
void emplace_impl_no_rehash(node_tmp& a)
|
||||||
{
|
{
|
||||||
key_type const& k = this->get_key(a.value());
|
key_type const& k = this->get_key(a.value());
|
||||||
std::size_t key_hash = this->hash(k);
|
std::size_t key_hash = this->hash(k);
|
||||||
this->add_node(a, key_hash, this->find_node(key_hash, k));
|
iterator position = this->find_node(key_hash, k);
|
||||||
|
this->add_node(a.release(), key_hash, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||||
|
@ -308,13 +308,6 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
|
|
||||||
// Emplace/Insert
|
// Emplace/Insert
|
||||||
|
|
||||||
inline iterator add_node(
|
|
||||||
node_tmp& a,
|
|
||||||
std::size_t key_hash)
|
|
||||||
{
|
|
||||||
return add_node(a.release(), key_hash);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline iterator add_node(
|
inline iterator add_node(
|
||||||
node_pointer n,
|
node_pointer n,
|
||||||
std::size_t key_hash)
|
std::size_t key_hash)
|
||||||
@ -351,7 +344,7 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
{
|
{
|
||||||
node_tmp b(n, this->node_alloc());
|
node_tmp b(n, this->node_alloc());
|
||||||
this->reserve_for_insert(this->size_ + 1);
|
this->reserve_for_insert(this->size_ + 1);
|
||||||
return this->add_node(b, key_hash);
|
return this->add_node(b.release(), key_hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
value_type& operator[](key_type const& k)
|
value_type& operator[](key_type const& k)
|
||||||
@ -437,7 +430,7 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
// reserve has basic exception safety if the hash function
|
// reserve has basic exception safety if the hash function
|
||||||
// throws, strong otherwise.
|
// throws, strong otherwise.
|
||||||
this->reserve_for_insert(this->size_ + 1);
|
this->reserve_for_insert(this->size_ + 1);
|
||||||
return emplace_return(this->add_node(b, key_hash), true);
|
return emplace_return(this->add_node(b.release(), key_hash), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
@ -487,7 +480,7 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
boost::unordered::detail::insert_size(i, j));
|
boost::unordered::detail::insert_size(i, j));
|
||||||
|
|
||||||
// Nothing after this point can throw.
|
// Nothing after this point can throw.
|
||||||
this->add_node(b, key_hash);
|
this->add_node(b.release(), key_hash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -513,7 +506,7 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
// reserve has basic exception safety if the hash function
|
// reserve has basic exception safety if the hash function
|
||||||
// throws, strong otherwise.
|
// throws, strong otherwise.
|
||||||
this->reserve_for_insert(this->size_ + 1);
|
this->reserve_for_insert(this->size_ + 1);
|
||||||
this->add_node(b, key_hash);
|
this->add_node(b.release(), key_hash);
|
||||||
}
|
}
|
||||||
} while(++i != j);
|
} while(++i != j);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user