Am 24.09.2013 15:50, schrieb Xiangrong Fang:
Hi Sven,
2013/9/23 Xiangrong Fang <xrf...@gmail.com <mailto:xrf...@gmail.com>>
Short answer: you can't. The same would happen with normal
classes.
Long answer: You could add an additional method "Next" to your
"TIntTree" which returns a "TIntTree" and just do "Result :=
TIntTree(inherited Next);" there.
I still have problem with this strange issue. See the demo program
below:
program test;
{$mode objfpc}{$H+}
uses treap;
type
TStringMapper = class(specialize TTreap<string, string>)
end;
var
sm1, sm2: TStringMapper;
n: TStringMapper.PNode;
begin
sm1 := TStringMapper.Create;
for n in sm1.Reversed do WriteLn(n^.Key); <-- but NOT here
sm2 := sm1.Reversed; <-- error here
end.
How is PNode declared? What is the exact error?
Why is this? Also, I found that the keyword "specialize" is
recognized in fpc mode, but "class" is only valid in objfpc mode, is
that correct?
"specialize" is used in all modes except mode Delphi for
specializations. "class" is available in all modes except "iso", "tp"
and "fpc", but can be enabled there using {$modeswitch class}.
Regards,
Sven
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal