DIP 57: static foreach

Idan Arye via Digitalmars-d digitalmars-d at puremagic.com
Wed Nov 4 03:41:54 PST 2015

On Tuesday, 3 November 2015 at 20:28:43 UTC, Andrei Alexandrescu 
> On 11/03/2015 03:12 PM, Shammah Chancellor wrote:
>> Ditto.  This needs `static continue` and `static break`.  
>> Without this
>> functionality, the control flow in `static foreach` becomes 
>> very unwieldy.
> "continue" and "break" (no static) should just work. -- Andrei

Depending on what you want `continue` and `break` to do. Consider 
this: http://dpaste.dzfl.pl/925e4aec6173

Note that the pragma gets compiled for `true` even though we 
`continue` before it. This is the expected behavior from 
`continue`, but a `static continue` should have skipped that, and 
a static break should have skipped the compilation of the rest of 
the AliasSeq.

More information about the Digitalmars-d mailing list