Template interface and class

Jason House jason.james.house at gmail.com
Wed May 30 16:59:16 PDT 2007


gerleim wrote:
> The following will result in
> "class test.C1 interface function I1.Foo isn't implemented"
> 
> class C1 : I1
> {}
> public interface I1
> {
> 	void Foo();
> }
> 
> , but 
> class C(T) : I!(T)
> {}
> 
> public interface I(T)
> {
> 	T Foo();
> }
> 
> will give compile error only if a declaration of the class is present somewhere.
> 
> Is this normal?


On a side note... void bar (I!(int) i){ i.Foo() }
will not work because templated functions are never virtual.


More information about the Digitalmars-d-learn mailing list