On 12/27/10, Simen kjaeraas <simen.kja...@gmail.com> wrote: > > Yes indeed. This was what I meant by saying that template functions > cannot be virtual. D sadly has no way to create templated functions > that work in a class hierarchy. :( >
Does it really make sense for a class to have methods that accept any type of argument? It's one thing to have a class specialized on some type(s), e.g.: class Foo(T1, T2) { void bar(T1 var, T2 etc) { } } But having a class method which can accept any type, that seems odd to me. I don't know since I've never used such a thing before, but maybe it has some good use cases? (I'd love to know about those btw!). You can introduce constraints, but I thought having parameterized classes would solve most of the use-case scenarios.