Fix the memory leak tested in 5751152733

This commit is contained in:
Denis Blank 2018-01-29 00:33:53 +01:00
parent 032fc436b9
commit 9c4b0a3a17

View File

@ -194,6 +194,12 @@ public:
expected& operator=(expected const&) = default;
expected& operator=(expected&&) = default;
~expected() noexcept(
std::is_nothrow_destructible<T>::value&&
std::is_nothrow_destructible<types::error_type>::value) {
weak_destroy();
}
explicit expected(T value) //
: expected(std::move(value), detail::slot_t::value) {
}