+1



Sent from my Galaxy


-------- Original message --------
From: Thiago Macieira via Std-Proposals <std-proposals@lists.isocpp.org>
Date: 10/24/25 2:53 PM (GMT+01:00)
To: std-proposals@lists.isocpp.org
Cc: Thiago Macieira <thiago@macieira.org>
Subject: Re: [std-proposals] Replace an object -- but retain old object if new object fails to construct

On Friday, 24 October 2025 06:25:27 Pacific Daylight Time Sebastian Wittmeier
via Std-Proposals wrote:
> The difficulty is not knowing, whether construction works.
>
> Otherwise the old object can be destructed first and the new one
> constructed.
>
>
> To abstract this more, it is like a failing transaction, which can be rolled
> back.

I think that's an even more important question: how often do we need this
replacement solution whereby the previously-stored object is present if the
new one throws on construction?

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