Are moved-from objects required to be destructed?
问题 If I move-construct a from b , is it still necessary to destruct b , or can I get away without doing so? This question crossed my mind during the implementation of an optional<T> template. Excerpt: ~optional() { if (initialized) { reinterpret_cast<T*>(data)->~T(); } } optional(optional&& o) : initialized(o.initialized) { if (initialized) { new(data) T(std::move(*o)); // move from o.data o.initialized = false; // o.data won't be destructed anymore! } } Of course, I could just replace the bool