The Strange Loop conference

Timon Gehr timon.gehr at gmx.ch
Wed Sep 21 14:53:46 PDT 2011


On 09/21/2011 11:11 PM, Andrei Alexandrescu wrote:
> On 9/21/11 3:34 PM, Peter Alexander wrote:
>> What if foo is a virtual member function? Those can't be templates.
>
> Then it would need to take a dynamic Range as parameter, parameterized
> with the element type.
>

Would it be a good idea to allow this?

to!Interface(structInstance);

This would work if Struct implicitly fulfills the interface and return a 
class instance that is constructed on the fly and implements the 
interface by forwarding to the struct instance.

foo(to!IInputRange(map!(...)(...)));


More information about the Digitalmars-d mailing list