C++ Logo

std-proposals

Advanced search

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

From: organicoman <organicoman_at_[hidden]>
Date: Fri, 24 Oct 2025 16:06:42 +0100
+1Sent from my Galaxy
-------- Original message --------From: Thiago Macieira via Std-Proposals <std-proposals_at_[hidden]> Date: 10/24/25 2:53 PM (GMT+01:00) To: std-proposals_at_[hidden] Cc: Thiago Macieira <thiago_at_[hidden]> 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

Received on 2025-10-24 15:06:54