C++ Logo

std-proposals

Advanced search

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

From: organicoman <organicoman_at_[hidden]>
Date: Fri, 06 May 2022 12:38:17 +0400
The resource leaks. But that's fully defined behavior; you can accomplish the same by an unpaired resource acquisition: int main() { new int; } is a perfectly valid program.Yes, in the above example, terminating the program will take care of freeing the resource. My question is, what strong guarantee the "Relocation" concept will provide? In other words, what should I watch for? Since the closing curly baces will not mean "calling destructor" necessarily. Sent from my Galaxy
-------- Original message --------From: Edward Catmur <ecatmur_at_[hidden]> Date: 5/6/22 12:23 PM (GMT+04:00) To: std-proposals <std-proposals_at_[hidden]> Cc: Ville Voutilainen <ville.voutilainen_at_[hidden]>, organicoman <organicoman_at_[hidden]>, Sébastien Bini <sebastien.bini_at_[hidden]> Subject: Re: [std-proposals] Relocation in C++ On Fri, 6 May 2022 at 08:39, organicoman via Std-Proposals <std-proposals_at_[hidden]> wrote:What about non trivial struct, which free resources by calling its destructor?The resource leaks. But that's fully defined behavior; you can accomplish the same by an unpaired resource acquisition: int main() { new int; } is a perfectly valid program.

Received on 2022-05-06 08:38:24