digitalmars.D - Inherit from class template?
- James Dunne (8/8) Aug 28 2005 Why can I not inherit from a class template? I get an error saying the ...
- Ben Hinkle (6/17) Aug 28 2005 Did you supply a template parameter? eg
- James Dunne (8/28) Aug 28 2005 Well, I'll be darned. I swear it was breaking, which was totally weird....
Why can I not inherit from a class template? I get an error saying the template can't be used as a type. For one thing, the error message is misleading, because you can use the template class as a type - to declare a variable of that type as well as use it in the new operator. What is the issue impeding using class templates as parent classes? Regards, James Dunne
Aug 28 2005
"James Dunne" <james.jdunne gmail.com> wrote in message news:desvq8$12b6$1 digitaldaemon.com...Why can I not inherit from a class template? I get an error saying the template can't be used as a type. For one thing, the error message is misleading, because you can use the template class as a type - to declare a variable of that type as well as use it in the new operator. What is the issue impeding using class templates as parent classes? Regards, James DunneDid you supply a template parameter? eg class Foo(T) {...} class Bar : Foo!(int) {...} class Baz(T) : Foo!(T) {...}
Aug 28 2005
In article <det0er$133b$1 digitaldaemon.com>, Ben Hinkle says..."James Dunne" <james.jdunne gmail.com> wrote in message news:desvq8$12b6$1 digitaldaemon.com...Well, I'll be darned. I swear it was breaking, which was totally weird. But I try it again and it all works. I must've done something weird... I think I shall investigate further. Perhaps I've discovered some obscure special case. Thanks for making me check over my code, Ben! Regards, James DunneWhy can I not inherit from a class template? I get an error saying the template can't be used as a type. For one thing, the error message is misleading, because you can use the template class as a type - to declare a variable of that type as well as use it in the new operator. What is the issue impeding using class templates as parent classes? Regards, James DunneDid you supply a template parameter? eg class Foo(T) {...} class Bar : Foo!(int) {...} class Baz(T) : Foo!(T) {...}
Aug 28 2005