Date: Sun, 11 Sep 2022 22:39:02 +0800
I wonder if it would allow implementations to make optimizations, such as
reusing the storage occupied by such objects?
And it provides consistency (but I'm not sure that consistency is worth it).
On Sun, Aug 28, 2022 at 9:06 PM blacktea hamburger
<IMCEAEX-_O=FIRST+20ORGANIZATION_OU=EXCHANGE+20ADMINISTRATIVE+20GROUP+28FYDIBOHF>
wrote:
> Calling the destructor multiple times on a class object results in
> undefined behavior according to [class.dtor]/19
> <https://eel.is/c++draft/class.dtor#19>:
>
> Once a destructor is invoked for an object, the object's lifetime ends;
> the behavior is undefined if the destructor is invoked for an object whose
> lifetime has ended ([basic.life]).
>
>
> However, similar thing doesn't apply to pseudo-destructor calls.
>
> P0593R6 <https://wg21.link/P0593R6> makes pseudo-destructor calls end
> objects' lifetimes. I wonder if adding such a provision would be useful.
>
>
>
reusing the storage occupied by such objects?
And it provides consistency (but I'm not sure that consistency is worth it).
On Sun, Aug 28, 2022 at 9:06 PM blacktea hamburger
<IMCEAEX-_O=FIRST+20ORGANIZATION_OU=EXCHANGE+20ADMINISTRATIVE+20GROUP+28FYDIBOHF>
wrote:
> Calling the destructor multiple times on a class object results in
> undefined behavior according to [class.dtor]/19
> <https://eel.is/c++draft/class.dtor#19>:
>
> Once a destructor is invoked for an object, the object's lifetime ends;
> the behavior is undefined if the destructor is invoked for an object whose
> lifetime has ended ([basic.life]).
>
>
> However, similar thing doesn't apply to pseudo-destructor calls.
>
> P0593R6 <https://wg21.link/P0593R6> makes pseudo-destructor calls end
> objects' lifetimes. I wonder if adding such a provision would be useful.
>
>
>
Received on 2022-09-11 14:39:29