On Monday, 9 July 2012 at 20:25:58 UTC, Roman D. Boiko wrote:
On Monday, 9 July 2012 at 20:21:18 UTC, Mehrdad wrote:
Why isn't transform taking in both an input and an output
range in the first place? Of course they might be the same,
but they don't have to be.
Could you make a detailed proposal? I still completely don't
understand neither the problem you're trying to solve, nor the
solution you have in mind.
Well, I'm not even sure if the proposal is necessary yet, since
it would be solved another way -- I'm not sure if transform
should be taking 1 range as input or 2.
I mean like, why isn't it defined this way instead?
void transform(alias f, RI, RO)(RI r, RO output)
if(isInputRange!RI && isOutputRange!RO)
{
for(; !r.empty; r.popFront())
output.put(unaryFun!f(r.front));
}
If that works, then I still think we don't need assignable
front()s after all.