[fpc-pascal] Re: Use generic class as parameter (was: how to write enumerator for trees)

Sven Barth pascaldragon at googlemail.com
Fri Mar 22 07:45:40 CET 2013


Am 22.03.2013 02:32 schrieb "Xiangrong Fang" <xrfang at gmail.com>:
>
> Hi,
>
> I missed the key point. This bug should be fixed in 2.7.1, but I am now
using 2.6.0.   Now there is another problem:
>
> If I change my code to this:
>
>
>       TTreapEnumerator = class
>         FStack: TStack;
>         FCurrent: PNode;
>       public
>         constructor Create(root: PNode);
>
>         destructor Destroy; override;
>         function MoveNext: Boolean;
>         property Current: PNode read FCurrent;
>       end;
>
> The problem is gone, because PNode is not a generic class, but only a
record.   However, the following errors are generated:

2.6.x does not support nested types in generics. Generic fixes and
improvements are only found in 2.7.1 as most of them were to invasive to be
merged back.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130322/cd4b2d18/attachment.html>


More information about the fpc-pascal mailing list