C++ Logo

std-proposals

Advanced search

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

From: Oliver Hunt <oliver_at_[hidden]>
Date: Thu, 30 Oct 2025 12:25:07 -0700
> On Oct 30, 2025, at 10:44 AM, Thiago Macieira via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> On Thursday, 30 October 2025 10:17:47 Pacific Daylight Time Sebastian Wittmeier
> via Std-Proposals wrote:
>> What is the disadvantage of using std::trivially_relocate()?
>
> Unless it's guaranteed to be no-op for everyone, it requires extracting for
> type-erasure, something we don't do now. And if it requires extracting for
> *some* types, I need to know which types it is required for, so I don't have
> to extract it for all types. Extracting unnecessarily creates more relocations
> (used here in the old sense) in the binary, which slows down load time.

I still don’t understand this - how do you deal with non-copyable types today?

—Oliver

Received on 2025-10-30 19:25:14