May 29, 2009 Template subclasses | ||||
---|---|---|---|---|
| ||||
I'm curious how someone implements a templated class. Basically, how do I do this: Class Foo(T) { T bar; } Class Fee:Foo { T fum; } Any ideas? thanks -Andrew |
May 29, 2009 Re: Template subclasses | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrew | On Thu, May 28, 2009 at 11:11 PM, Andrew <andrew.spott@gmail.com> wrote:
> I'm curious how someone implements a templated class. Basically, how do I do this:
>
> Class Foo(T) {
> T bar;
> }
>
> Class Fee:Foo {
> T fum;
> }
>
> Any ideas?
>
> thanks
>
> -Andrew
>
You instantiate the base class.
class Fee(T) : Foo!(T)
{
T fum;
}
|
Copyright © 1999-2021 by the D Language Foundation