Templated member functions in interfaces

Jason House jason.james.house at gmail.com
Thu Apr 19 18:02:17 PDT 2007


Jarrett Billingsley wrote:
> "Jason House" <jason.james.house at gmail.com> wrote in message 
> news:f06gv1$mcd$1 at digitalmars.com...
>> That seems to imply that having a variable of interface type should not be 
>> allowed if that interface contains templated member functions...
> 
> Or make templated member functions in interfaces illegal, since they can't 
> ever be overloaded, and what's an interface for, after all? 
> 
> 

I was thinking about that.  An interface can be used to define what a 
class should contain even if it can't be used in any polymorphic sense. 
  I can then make a function templated to accept a class and assume it 
conforms to an interface (maybe a static check?).  Sadly, when I did 
that, the call to the templated member function failed to get linked in. 
  Commenting out the interface use fixed the problem.  Weird...


More information about the Digitalmars-d-learn mailing list