C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Replace an object -- but retain old object if new object fails to construct

From: Thiago Macieira <thiago_at_[hidden]>
Date: Mon, 27 Oct 2025 08:05:15 -0700
On Monday, 27 October 2025 03:48:59 Pacific Daylight Time Frederick Virchanza
Gotham via Std-Proposals wrote:
> Change No. 1: The destruction of a moved-from object should always
> be equivalent to a no-op and can therefore be elided

You're describing the objective of relocation. A relocated object exists only
in the new location; there's nothing in the old, so there's no need to run the
destructor there.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Data Center Group

Received on 2025-10-27 15:05:26