C++ Logo

std-proposals

Advanced search

Re: [std-proposals] consteval int relocatability

From: Thiago Macieira <thiago_at_[hidden]>
Date: Tue, 11 Nov 2025 07:13:21 -0800
On Tuesday, 11 November 2025 06:34:06 Pacific Standard Time Frederick Virchanza
Gotham via Std-Proposals wrote:
> What I’m trying to understand though is why the old address has to be
> exposed in the interface at all?

I believe it's not for restart_lifetime, but for a different type of (non-
trivial) relocation where the identity of the pointer that had been mangled
isn't known. This would be a "simple" decrypt the pointer to its cleartext
form, then encrypt again.

This is the scenario that I was thinking of when I replied in the chat about
there being one. Except that it is a case of non-trivial relocation, something
I realised after Arthur explained to me that std::restart_lifetime<T>() would
make it UB to restart the lifetime with a different dynamic type than the old
lifetime.

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

Received on 2025-11-11 15:13:27