C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] More flexible break statements.
From: Jake Arkinstall (jake.arkinstall_at_[hidden])
Date: 2019-08-17 03:35:41


On Fri, 16 Aug 2019, 23:37 Hyman Rosen via Std-Proposals, <
std-proposals_at_[hidden]> wrote:

> This is so obviously the right thing to do that I'm confident that the
> design of C++ is in the wrong hands, and has been for a long time.
> There is nothing to be done unless an insurrection of people fed up
> with the status quo join the committee and change its direction.
>

It's a goto-esque solution to a problem that already has a modern solution,
as Arthur demonstrates, which is more readable and doesn't change behaviour
when used in different contexts.

The idea with the switch seems, at first, nifty. But to me it highlights
bad use of switch statements (though to me, any fall through is a bad use
of a switch statement), especially when if statements are clearer and less
like spaghetti.

I support the committee's general movement towards getting rid of the need
to use macros over inventing new hacky idioms to support their use further.
To be fair, at this point all they need to do is support auto NSDMI:

auto make_something(){
  auto foo = ...;
   ...
   return foo;
}
struct S{
     // no need for decltype:
     auto x = make_something();
};

And I can honestly say that I'd have zero uses for macros these days.



STD-PROPOSALS list run by herb.sutter at gmail.com

Standard Proposals Archives on Google Groups