Breaking out of multiple loops

2012-09-05 Thread Michel Colman
I have a very simple suggestion for breaking out of nested loops. Currently, there are a few ways of breaking out of multiple nested loops but they all have unnecessary drawbacks: - exceptions (performance penalty, complexity) - using boolean flags that are checked in every iteration (performa

Re: Add := digraph to D

2012-06-22 Thread Michel Colman
I believe that auto has been redefined in C++11 as well. In both, all it really means is that the type is inferred. That's what I seemed to remember as well. Originally it had something to do with scope, but it was basically obsolete because that was the default anyway, so nobody was using it.

Re: Add := digraph to D

2012-06-22 Thread Michel Colman
I believe that auto has been redefined in C++11 as well. In both, all it really means is that the type is inferred. That's what I seemed to remember as well. Originally it had something to do with scope, but it was basically obsolete because that was the default storage class anyway, so nobod

Re: for() with 4 arguments to allow postcondition

2012-06-22 Thread Michel Colman
Isn't this what a do-while loop is for, or am I missing something? Well, yes, but then you don't need the regular "for" loop either. After all, isn't that what a "while" loop is for? The big advantage of "for" is that you can see at a glance what the initialisation, condition(s) and incremen

for() with 4 arguments to allow postcondition

2012-06-19 Thread Michel Colman
I have a suggestion for D (which might make it into C/C++ as well, but I thought D would be a more accessible place to suggest it): for(initializer; precondition; postcondition; increment) would allow avoiding a useless comparison before the start of the first iteration of a "for" loop in those