Modern C++ Lamentations
john.loughran.colvin at gmail.com
Sun Dec 30 12:27:24 UTC 2018
On Saturday, 29 December 2018 at 22:01:58 UTC, Steven
> On 12/29/18 4:29 AM, Walter Bright wrote:
>> Time to show off your leet D skilz and see how good we can do
>> it in D!
> Ugh, ranges really aren't a good fit for emulating nested
> loops, unless you write a specialized one.
> I tried my best, but it kind of sucks:
> foreach(z, x, y;
> .map!(a =>
> zip(StoppingPolicy.shortest, a.repeat, iota(1, a)))
> .map!(t =>
> zip(StoppingPolicy.shortest, t.repeat,
> t.repeat, iota(t, t)))
> .filter!(t => t*t == t*t + t*t)
> writeln(x, " ", y, " ", z);
Isn't "StoppingPolicy.shortest" the default?
More information about the Digitalmars-d