C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Relocation in C++

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Tue, 1 Feb 2022 20:00:15 +0100
Il 01/02/22 18:02, S├ębastien Bini via Std-Proposals ha scritto:
> Not sure I understand. Why would the compiler decide to destroy
> other.ptr in the relocation constructor? And having other destructed
> again is a programming error (like doing: `IntBuffer x; x.~IntPtr();` x
> is destructed twice) and should not happen. Using the reloc operator
> guarantees things will be safe.

Apologies for the confusion, I was referring to the scenario where it
would be a QoI whether a relocated object is considered destroyed or its
destructor would be ran nevertheless. In such a scenario _a lot_ of
things start falling apart.

My 2 c,

-- 
Giuseppe D'Angelo | giuseppe.dangelo_at_[hidden] | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

Received on 2022-02-01 19:00:19