Re: Forwarding calls to objects of another type

2017-04-19 Thread Johan Fjeldtvedt via Digitalmars-d-learn
On Tuesday, 11 April 2017 at 02:01:19 UTC, Nicholas Wilson wrote: On Monday, 10 April 2017 at 21:27:34 UTC, Basile B. wrote: 2) This is about the reduce templates. As I've commented, I can't use a template lambda with reduce, but I can use a lambda taking ints as arguments. Why is this? The

Re: Forwarding calls to objects of another type

2017-04-19 Thread Johan Fjeldtvedt via Digitalmars-d-learn
On Monday, 10 April 2017 at 21:27:34 UTC, Basile B. wrote: On Monday, 10 April 2017 at 21:04:10 UTC, Johan Fjeldtvedt wrote: [...] One way: [...] Thanks for the reply. The traits way of doing it seems to be what I want. :) [...] [...]

Re: Forwarding calls to objects of another type

2017-04-10 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 10 April 2017 at 21:27:34 UTC, Basile B. wrote: 2) This is about the reduce templates. As I've commented, I can't use a template lambda with reduce, but I can use a lambda taking ints as arguments. Why is this? The error message I get when using the template lambda is: "template

Re: Forwarding calls to objects of another type

2017-04-10 Thread Basile B. via Digitalmars-d-learn
On Monday, 10 April 2017 at 21:04:10 UTC, Johan Fjeldtvedt wrote: I have a couple of questions related to the following code: https://gist.github.com/Jaffe-/b027287a884fc2e173a65601ec242676 1) This is a very simplified example, but what I'm trying to do here is to call `foo` on each object in

Forwarding calls to objects of another type

2017-04-10 Thread Johan Fjeldtvedt via Digitalmars-d-learn
I have a couple of questions related to the following code: https://gist.github.com/Jaffe-/b027287a884fc2e173a65601ec242676 1) This is a very simplified example, but what I'm trying to do here is to call `foo` on each object in `Container.ss` contains when `foo` is called, and likewise for