C++ Logo

std-discussion

Advanced search

Re: DestructorConstructor - a class destructor with parameter

From: Thiago Macieira <thiago_at_[hidden]>
Date: Wed, 10 Feb 2021 14:02:42 -0800
On Wednesday, 10 February 2021 13:52:07 PST Maciej Polanski via Std-Discussion
wrote:
> I would like to present a (revolutionary?) concept of
> "DestructorConstructor", a class destructor with parameter -
> uninitialized object. Such destructor and constructor in one, while
> destructing its (own) object, moves data to new (parameter) object with
> cost of "C" styled "memcpy".
> I've been thinking about this concept for some time. I have trouble
> completing it, but I think it is sufficiently valuable to present it to
> community... even if only to be shown I am a moron

See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4034.pdf and
other proposals for "destructive move".

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DPG Cloud Engineering

Received on 2021-02-10 16:02:47