Re: Template in interface ?

2009-03-01 Thread Christopher Wright
TSalm wrote: Le Sun, 01 Mar 2009 03:07:16 +0100, Christopher Wright a écrit: TSalm wrote: Does something have an idea on how to do something like this ? You don't. Templates cannot participate in polymorphism. I've dealt with this in the past and ended up making another class with a temp

Re: Template in interface ?

2009-03-01 Thread TSalm
Le Sun, 01 Mar 2009 03:07:16 +0100, Christopher Wright a écrit: TSalm wrote: Does something have an idea on how to do something like this ? You don't. Templates cannot participate in polymorphism. I've dealt with this in the past and ended up making another class with a template parame

Re: Template in interface ?

2009-02-28 Thread Christopher Wright
TSalm wrote: Does something have an idea on how to do something like this ? You don't. Templates cannot participate in polymorphism. I've dealt with this in the past and ended up making another class with a template parameter that corresponds to the desired function template parameter... Ba

Template in interface ?

2009-02-28 Thread TSalm
Hello, I need to do something like this : /* CODE */ import tango.io.Stdout; interface I { bool cmpType(U)(U val); } class A(T):I { bool cmpType(U)(U val) { static if ( is (U==T) ) return true; else return false; } } void main() { I a = new A!(int);