We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87bc96c commit 89e73e1Copy full SHA for 89e73e1
modules/strong_ptr.cppm
@@ -284,14 +284,7 @@ struct rc
284
if (p_object != nullptr) {
285
// Cast back into the original rc<T> type and ...
286
auto const* obj = static_cast<rc<T> const*>(p_object);
287
- // Destruct T.
288
- obj->m_object.~T();
289
- // Destructor ref_info if its not trivially destructible. In general, this
290
- // should never be the case, but if we do modify ref_info to have a
291
- // non-trivial destructor, this will automatically manage that.
292
- if constexpr (not std::is_trivially_destructible_v<ref_info>) {
293
- obj->m_info.~ref_info();
294
- }
+ obj->~rc<T>();
295
}
296
// Return size for future deallocation
297
return sizeof(rc<T>);
0 commit comments