digitalmars.D.learn - Template resolution and interfaces
- Torje Digernes (9/9) Dec 10 2013 http://pastie.org/8542555
- qznc (8/20) Dec 11 2013 Your code creates an alias, which only exists at compile-time but
- Torje Digernes (4/28) Dec 11 2013 No other reason than that it looks cleaner to me than wrappers. I
http://pastie.org/8542555 Compositing an class via curry fails when I try to use interfaces. Guessing that this is due to when classes are validated for interface implementation and when templates are instantiated. I thought this was a cool optional way to build/composite classes instead of wrappers. Don't think it has inherent advantages (except that trivial wrappers look silly), just another way to do it. Any chance I can do this anytime soon? Or already by writing somewhat smarter?
Dec 10 2013
On Tuesday, 10 December 2013 at 17:50:45 UTC, Torje Digernes wrote:http://pastie.org/8542555 Compositing an class via curry fails when I try to use interfaces. Guessing that this is due to when classes are validated for interface implementation and when templates are instantiated. I thought this was a cool optional way to build/composite classes instead of wrappers. Don't think it has inherent advantages (except that trivial wrappers look silly), just another way to do it. Any chance I can do this anytime soon? Or already by writing somewhat smarter?Your code creates an alias, which only exists at compile-time but not at run-time. The compiler error "interface function 'void mpriority()' is not implemented" is correct. A naive implementation is straightforward: void mpriority() { priority(myData); } Why do you want to use curry?
Dec 11 2013
On Wednesday, 11 December 2013 at 10:10:11 UTC, qznc wrote:On Tuesday, 10 December 2013 at 17:50:45 UTC, Torje Digernes wrote:No other reason than that it looks cleaner to me than wrappers. I tried it because I thought it should work, as I could call it by that name, but I now see the problem.http://pastie.org/8542555 Compositing an class via curry fails when I try to use interfaces. Guessing that this is due to when classes are validated for interface implementation and when templates are instantiated. I thought this was a cool optional way to build/composite classes instead of wrappers. Don't think it has inherent advantages (except that trivial wrappers look silly), just another way to do it. Any chance I can do this anytime soon? Or already by writing somewhat smarter?Your code creates an alias, which only exists at compile-time but not at run-time. The compiler error "interface function 'void mpriority()' is not implemented" is correct. A naive implementation is straightforward: void mpriority() { priority(myData); } Why do you want to use curry?
Dec 11 2013