Commit ef186943 authored by Nick Terrell's avatar Nick Terrell Committed by Facebook GitHub Bot

Require is_nothrow_destructible in F14Node tables

Summary: We will `std::terminate` if a destructor throws, so it would be better to complain about throwing destructors in the first place.

Reviewed By: nbronson

Differential Revision: D20604722

fbshipit-source-id: d36c771f36d0d0a26f356720698606de628ca747
parent 6123dc9f
......@@ -881,7 +881,18 @@ class NodeContainerPolicy
prefetchAddr(std::addressof(*item));
}
template <typename T>
std::enable_if_t<std::is_nothrow_destructible<T>::value>
complainUnlessNothrowDestroy() {}
template <typename T>
[[deprecated("Mark key and mapped type destructor nothrow")]] std::
enable_if_t<!std::is_nothrow_destructible<T>::value>
complainUnlessNothrowDestroy() {}
void destroyItem(Item& item) noexcept {
complainUnlessNothrowDestroy<Key>();
complainUnlessNothrowDestroy<lift_unit_t<MappedTypeOrVoid>>();
if (item != nullptr) {
Alloc& a = this->alloc();
AllocTraits::destroy(a, std::addressof(*item));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment