D as a prototyping language (for C/C++ projects)

Timon Gehr timon.gehr at gmx.ch
Sat Mar 2 05:55:29 PST 2013


On 02/28/2013 06:08 PM, Andrei Alexandrescu wrote:
> ...
>
> So my thought on the subject - I don't care much for
>
> T tap(alias func)(T x) { func(x); return x; }
>

I'm not sure who would.

template tap(alias func){ T tap(T)(T x){ func(x); return x; } }

> It's the kind of chaff that doesn't do any real work and only dilutes
> the value of a library,  but I do think a tap tapping into a range does
> real work  and would be a valuable addition.
>...

map!(tap!func)


More information about the Digitalmars-d mailing list