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: Thu, 30 Oct 2025 07:27:38 -0700
On Wednesday, 29 October 2025 14:24:23 Pacific Daylight Time Thiago Macieira
via Std-Proposals wrote:
> I disagree because I don't want to wait for that operation. I want
> relocations now. In fact, I want them in 2005, when Qt began doing them
> anyway. It's memcpy/memmove, period.

Oh, and realloc(). That's actually the most important one.

I'll accept a replacement function if realloc() can't be fixed. But there needs
to be something that resizes an allocated memory block for trivially-
relocatable objects and has a good chance of not moving the memory block
(resize-in-place). Was that added by P2786?

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Data Center - Platform & Sys. Eng.

Received on 2025-10-30 14:27:47