Unreachable warning is annoying

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Mar 13 17:43:36 UTC 2018


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.  Foreach on a tuple does *not* skip expanding all
iterations of the loop regardless of any `break`s or `continue`s. It's
the codegen that eliminates the resulting dead code.  See:

	https://wiki.dlang.org/User:Quickfur/Compile-time_vs._compile-time#Case_Study:_foreach_over_a_type_list


T

-- 
"No, John.  I want formats that are actually useful, rather than over-featured megaliths that address all questions by piling on ridiculous internal links in forms which are hideously over-complex." -- Simon St. Laurent on xml-dev


More information about the Digitalmars-d mailing list