Re: limited type
- From: Robert A Duff <bobduff@xxxxxxxxxxxxxxxxxxxx>
- Date: 30 Sep 2005 13:09:19 -0400
"adaman" <nicolas.blanpain@xxxxxxxxxxxxxxxxxx> writes:
> Hello,
>
> 1°) I have a tagged limited type. I want also to derived this type
> from an other not limited. Is is possible ? Example :
> type T_Object is tagged private;
> type T_Toto is new T_Object with limited private. Possible ????
No. Limited types are supposed to prevent copying, and this is intended
to be checkable at compile time. If you could do the above, then you
could copy values of type T_Object'Class whose tag is T_Toto'Tag
-- a loophole.
> 2°) I have a tagged limited type. I have an other which derived from
> this base type. Is this new type is limited ? Example :
> type T_Object is tagged limited private;
> type T_Toto is new T_Object with private. Is is Toto limited ????
Yes, T_Toto is limited, for similar reasons as above.
- Bob
.
- References:
- limited type
- From: adaman
- limited type
- Prev by Date: Re: New to Ada, noticing something strange.
- Next by Date: Re: What about big integers in Ada 2005?
- Previous by thread: limited type
- Index(es):