http://d.puremagic.com/issues/show_bug.cgi?id=5935
Lutger <lutger.blijdest...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lutger.blijdest...@gmail.co | |m --- Comment #5 from Lutger <lutger.blijdest...@gmail.com> 2011-05-09 10:18:44 PDT --- If no language changes for range iteration and tuple unpacking will be made, perhaps it's worth to consider a generic wrapper for this purpose as a compromise? I couldn't think of a good name: auto iterUntupled(R)(R input) if ( isInputRange!R && is( typeof( { auto x = input.front.tupleof; }() ) ) ) { static struct IterUntupled(R) { this(R input) { _input = input; } int opApply( int delegate( ref typeof(_input.front.tupleof) ) dg ) { while( !_input.empty) { auto front = _input.front; if ( auto result = dg(front.tupleof) ) return result; _input.popFront(); } return 0; } R _input; } return IterUntupled!R(input); } This will also unpack arbitrary structs and classes, is that too loose? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------