mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 03:17:15 +02:00
hardened unchecked_rehash against exceptions thrown in the middle of value move construction
This commit is contained in:
@ -1627,8 +1627,11 @@ private:
|
|||||||
std::size_t num_tx=0;
|
std::size_t num_tx=0;
|
||||||
BOOST_TRY{
|
BOOST_TRY{
|
||||||
for_all_elements([&,this](value_type* p){
|
for_all_elements([&,this](value_type* p){
|
||||||
nosize_transfer_element(p,new_arrays_);
|
/* We increment num_tx *before* actual transfer to guard us against
|
||||||
|
* exceptions thrown in the middle of value move construction.
|
||||||
|
*/
|
||||||
++num_tx;
|
++num_tx;
|
||||||
|
nosize_transfer_element(p,new_arrays_);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
BOOST_CATCH(...){
|
BOOST_CATCH(...){
|
||||||
|
Reference in New Issue
Block a user