On 03/15/2018 04:27 PM, Steven Schveighoffer wrote:
Note, I replied with the following text, but for some reason the forum
does NOT see this post. It should be here:
https://forum.dlang.org/post/p8990d$2ona$1...@digitalmars.com
And it does exist on the NNTP server.
It was received by Thunde
On 3/13/18 3:21 PM, Timon Gehr wrote:
On 13.03.2018 18:43, H. S. Teoh wrote:
On Tue, Mar 13, 2018 at 01:32:55PM -0400, Steven Schveighoffer via
Digitalmars-d wrote:
[...]
An unrolled foreach on a tuple has a notion that the flow control
jumps out of the loop, and it's OK to skip further loops
On 3/13/18 3:21 PM, Timon Gehr wrote:
On 13.03.2018 18:43, H. S. Teoh wrote:
On Tue, Mar 13, 2018 at 01:32:55PM -0400, Steven Schveighoffer via
Digitalmars-d wrote:
[...]
An unrolled foreach on a tuple has a notion that the flow control
jumps out of the loop, and it's OK to skip further loops
On 13.03.2018 18:43, H. S. Teoh wrote:
On Tue, Mar 13, 2018 at 01:32:55PM -0400, Steven Schveighoffer via
Digitalmars-d wrote:
[...]
An unrolled foreach on a tuple has a notion that the flow control
jumps out of the loop, and it's OK to skip further loops (even though
they are technically unrol
On Tue, Mar 13, 2018 at 01:32:55PM -0400, Steven Schveighoffer via
Digitalmars-d wrote:
[...]
> An unrolled foreach on a tuple has a notion that the flow control
> jumps out of the loop, and it's OK to skip further loops (even though
> they are technically unrolled).
[...]
This is not true. Fore
On 3/13/18 12:50 PM, Yuxuan Shui wrote:
On Tuesday, 13 March 2018 at 14:40:21 UTC, Steven Schveighoffer wrote:
On 3/13/18 10:25 AM, Yuxuan Shui wrote:
[...]
This has been discussed before. There are a few ways around this. One
is to do what you did. Another is to append a sentinel, or use id
On Tuesday, 13 March 2018 at 14:40:21 UTC, Steven Schveighoffer
wrote:
On 3/13/18 10:25 AM, Yuxuan Shui wrote:
[...]
This has been discussed before. There are a few ways around
this. One is to do what you did. Another is to append a
sentinel, or use id to terminate the loop:
foreach(id, R;
On 3/13/18 10:25 AM, Yuxuan Shui wrote:
See this simple example:
int staticFind(T, S...)() {
foreach(id, R; S) {
if (is(T == R))
return id;
}
}
return -1;
}
staticFind!(int, int, double) will generate a 'statement is unreachable'
warning, and stati