niedz., 7 kwi 2019 o 14:10 Peter Dimov via Boost
Bjorn Reese wrote:
The destructor should be marked as noexcept.
Destructors are noexcept by default.
Actually, that is not the case. The noexcept property of a destructor without explicit noexcept annotation is determined by inspecting noexcept property of destructors of non-static data members of the class and its base classes. Since these subobjects are private implementation of your class, and we are not aware of how their destructors are implemented, we cannot determine whether variant's destructor is noexcept or not. Here's an example: ``` class Detail { ~Detail() noexcept(false); }; class Variant { Detail _detail; }; static_assert(std::is_nothrow_destructible_v<Variant> == false); ``` Regards, &rzej;