<br><br><div class="gmail_quote">On Wed, Nov 11, 2009 at 17:44, Philippe Sigaud <span dir="ltr"><<a href="mailto:philippe.sigaud@gmail.com">philippe.sigaud@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote"><div>On Wed, Nov 11, 2009 at 16:48, dsimcha <span dir="ltr"><<a href="mailto:dsimcha@yahoo.com" target="_blank">dsimcha@yahoo.com</a>></span> wrote: </div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
If you uncomment a /*ref*/ in there somewhere, which was leftover from a<br>
compiler bug a long time ago, it seems to work. The real problem is that that bit<br>
of cruft hasn't been removed from Phobos yet.<br></blockquote></div></div></blockquote><div><br>So, it works. Thanks! <br><br>Strangely, on my computer it's frequently faster to use your enumerate than a raw range (re: your speed tests). Is there something I don't get? I thought (ie: read here) that opApply was slower than other means of iteration?<br>
My own enumerate, which produces a tuple(uint, T) as a lazy range is thrice as slow :(<br><br><br>And, I just discovered that I can simply unpack a tuple with .field or .expand.<br><br>auto t = tuple('a',1, 2.0);<br>
int foo(char a, int b, double c) { return to!int(a) * b * to!int(c);}<br>foo(t.expand) ; // works.<br><br>Is that common knowledge? It'd be nice addition to the std.typecons docs.<br><br> Gosh, when I think of the time I spent to find a way to extract this information with template recursion, to map a n-ary function on tuple-producing ranges. And all this time, I could have done tuple-mapping as a simple map on "foo(a.expand)".<br>
Time for some heavy refactoring... <br><br> Philippe<br></div></div>