On 11/17/16 10:38 AM, John Colvin wrote:
On Thursday, 17 November 2016 at 13:59:25 UTC, Steven Schveighoffer wrote:

But then the parameters to the "pushTo" hypothetical function don't
know what the source type is before calling. By inserting valves, I
get the equivalent thing, but the types all are passed down the chain

Can't you use a template lambda alias argument to pushTo instead, so
then you can instantiate it inside pushTo?

something like
    .pushTo!(_ => _

I could do that. But I don't like it ;)

I will note that Adrian Matoga's flod library has a different solution that I think is similar to this, but I don't understand it very well.

I'm also concerned that using a lambda is going to confuse or prevent optimization.

I think with some better naming, the push feature will look better.


Reply via email to