Mark destroyItem() as noexcept
Summary:
F14Node{Map,Set} doesn't require `is_nothrow_destructible<value_type>`. `clear()` and the destructor are both marked `noexcept`, so they will both terminate if the destructor throws. But `erase()` is not marked `noexcept`, so when the destructor throws during `erase()` the value is left in the map. This could be problematic if the value is half destroyed, or if `eraseInto()` is used.
This diff fixes the problem by marking `destroyItem()` as `noexcept`, so `std::terminate` is called whenever the value destructor throws.
Reviewed By: nbronson
Differential Revision: D20604276
fbshipit-source-id: c52c932d78d6ed61368985a749adf77c27a5a0de
Showing
Please register or sign in to comment