If Statement with Declaration
Nemanja Boric via Digitalmars-d
digitalmars-d at puremagic.com
Wed Jul 19 07:29:03 PDT 2017
On Wednesday, 19 July 2017 at 14:26:52 UTC, Dukc wrote:
> On Wednesday, 19 July 2017 at 13:37:50 UTC, Adam D. Ruppe wrote:
>> I like it.
>
> Me too. I think this should also apply to switch and with
> statements. Perhaps while statements too.
Right, C++17 has it also for a switch:
```
If init-statement is used, the switch statement is equivalent to
{
init_statement
switch ( condition ) statement
}
```
http://en.cppreference.com/w/cpp/language/switch
More information about the Digitalmars-d
mailing list