mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 11:27:15 +02:00
completed previous commit
This commit is contained in:
@ -1458,6 +1458,13 @@ private:
|
|||||||
alloc_traits::destroy(al(),p);
|
alloc_traits::destroy(al(),p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct destroy_on_exit
|
||||||
|
{
|
||||||
|
~destroy_on_exit(){this_->destroy_element(p);}
|
||||||
|
table* this_;
|
||||||
|
value_type* p;
|
||||||
|
};
|
||||||
|
|
||||||
std::size_t max_load()const
|
std::size_t max_load()const
|
||||||
{
|
{
|
||||||
static constexpr std::size_t small_capacity=2*N-1;
|
static constexpr std::size_t small_capacity=2*N-1;
|
||||||
@ -1688,9 +1695,10 @@ private:
|
|||||||
void nosize_transfer_element(value_type* p,const arrays_type& arrays_)
|
void nosize_transfer_element(value_type* p,const arrays_type& arrays_)
|
||||||
{
|
{
|
||||||
auto hash=hash_for(key_from(*p));
|
auto hash=hash_for(key_from(*p));
|
||||||
|
destroy_on_exit d{this,p};
|
||||||
|
(void)d; /* ununsed var warning */
|
||||||
nosize_unchecked_emplace_at(
|
nosize_unchecked_emplace_at(
|
||||||
arrays_,position_for(hash,arrays_),hash,type_policy::move(*p));
|
arrays_,position_for(hash,arrays_),hash,type_policy::move(*p));
|
||||||
destroy_element(p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
|
Reference in New Issue
Block a user