C++ Logo

std-discussion

Advanced search

Re: DestructorConstructor - a class destructor with parameter

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Thu, 11 Feb 2021 18:47:56 +0100
Hi,

On 11/02/2021 18:25, Maciej Polanski via Std-Discussion wrote:
> It seems that having "bitcopies" constructor does not guarantee empty
> destructor, nor lack of side effects of destructing empty object. It had
> to be found by compiler during optimization.
>
> Correct me if I am wrong, but if I was a library programmer, I wouldn't
> be able to find if I am allowed to memcpy of given class or not. Solely
> having "bitcopies" constructor is not enough.

See also P1144 and its algorithms , like relocate_at

> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1144r5.html#wording-relocate-at


HTH,
-- 
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 2021-02-11 11:48:09