Thread overview
subclassing templated class
Dec 26, 2010
spir
Dec 26, 2010
Simen kjaeraas
Dec 26, 2010
Stanislav Blinov
Dec 26, 2010
Simen kjaeraas
Dec 26, 2010
spir
December 26, 2010
Hello,

If I have
	class Node (Element) {...}
can I subtype it like with
	class Leaf (Element) : Node (Element) {...}
or such?

Denis
-- -- -- -- -- -- --
vit esse estrany ☣

spir.wikidot.com

December 26, 2010
spir <denis.spir@gmail.com> wrote:

> Hello,
>
> If I have
> 	class Node (Element) {...}
> can I subtype it like with
> 	class Leaf (Element) : Node (Element) {...}
> or such?

Yes.


-- 
Simen
December 26, 2010
On 12/26/2010 05:47 PM, spir wrote:
> Hello,
>
> If I have
> 	class Node (Element) {...}
> can I subtype it like with
> 	class Leaf (Element) : Node (Element) {...}
> or such?
>
> Denis

Absolutely:

class Leaf(Element) : Node!Element {...}
December 26, 2010
Stanislav Blinov <stanislav.blinov@gmail.com> wrote:

> On 12/26/2010 05:47 PM, spir wrote:
>> Hello,
>>
>> If I have
>> 	class Node (Element) {...}
>> can I subtype it like with
>> 	class Leaf (Element) : Node (Element) {...}
>> or such?
>>
>> Denis
>
> Absolutely:
>
> class Leaf(Element) : Node!Element {...}

You're right. I did not notice the lack of an exclamation mark.

-- 
Simen
December 26, 2010
On Sun, 26 Dec 2010 17:54:22 +0300
Stanislav Blinov <stanislav.blinov@gmail.com> wrote:

> > Hello,
> >
> > If I have
> > 	class Node (Element) {...}
> > can I subtype it like with
> > 	class Leaf (Element) : Node (Element) {...}
> > or such?
> >
> > Denis
> 
> Absolutely:
> 
> class Leaf(Element) : Node!Element {...}

Thank you! That's the syntactic bit I was missing. Logical, indeed...
Denis
-- -- -- -- -- -- --
vit esse estrany ☣

spir.wikidot.com