C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Execute statement when leaving scope

From: Gergely Nagy <gergely.nagy.alt_at_[hidden]>
Date: Mon, 12 Dec 2022 16:02:00 +0100
This would only be correct as

    ~ {
        if ( IsHardwareDevice(h) )
            FreeDevice(h);
        else
            FreeResource(h);
    };


Thiago Macieira via Std-Proposals <std-proposals_at_[hidden]> ezt írta
(időpont: 2022. dec. 12., H, 14:55):

> On Monday, 12 December 2022 07:32:34 -03 Frederick Virchanza Gotham via
> Std-
> Proposals wrote:
> > You see the curly tilde symbol ~, well my intention is that you locate
> > that symbol in the code, and then you look to the left of it to find
> > the first open curly brace, i.e. {.
>
> In other words, this
>
> if ( IsHardwareDevice(h) ) {
> ~ { FreeDevice(h); }
> } else {
> ~ { FreeResource(h) };
> }
>
> is different from this
>
> if ( IsHardwareDevice(h) )
> ~ { FreeDevice(h); }
> else
> ~ { FreeResource(h) };
>
> ?
>
> This sounds like a major flaw to me that would cause your feature
> suggestion to
> be DOA.
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Software Architect - Intel DCAI Cloud Engineering
>
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2022-12-12 15:02:17