C++ Logo

std-proposals

Advanced search

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

From: Thiago Macieira <thiago_at_[hidden]>
Date: Mon, 12 Dec 2022 10:55:18 -0300
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

Received on 2022-12-12 13:55:34