C++ Logo

std-proposals

Advanced search

[std-proposals] Relocating destructor and operator reloc

From: Àî ÇïÒÝ <QiuyiLi1023_at_[hidden]>
Date: Fri, 28 Jun 2024 16:31:30 +0000
Sorry for bother you. Seeing some proposals about relocating in C++, I think I found a easy and flexible way to do this with least changes to the core feature of C++ language. You can check it in the attachment or click https://github.com/YandereChan2/Relocating-destructor-and-operator-reloc/blob/main/Operator%20reloc%20and%20relocating%20destructor.md .

The core idea is introduce a new destructor T ~T(int), and with the help of RVO/NRVO to relocate an object from one address to the address of the return value.

Received on 2024-06-28 16:31:38