C++ Logo

std-proposals

Advanced search

Re: Optional braces for function definitions in some contexts

From: Arthur O'Dwyer <arthur.j.odwyer_at_[hidden]>
Date: Thu, 27 Jun 2019 13:01:03 -0400
On Thu, Jun 27, 2019 at 12:29 PM Kyle Knoepfel via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> Here’s an idea I’ve been thinking about a lot regarding functions composed
> of a single statement, and I’d like your thoughts.
> [...]
> Does this idea seem worth fleshing out? How difficult would it be for
> implementations to provide, if it was worthwhile?
>

No, it's not worth fleshing out. It is impossible for implementations to
provide. But investigating it further will likely teach you a lot of corner
cases about C++!

Look up "function try blocks."

Also, consider how you'd deal with

    void foo() /*{*/ noexcept(true); /*}*/

and

    struct S {
        void bar() const /*{*/ int dummy = 42; /*}*/
    };

HTH,
Arthur

Received on 2019-06-27 12:03:03