<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Hi Sven,<br><br>2013/9/23 Xiangrong Fang <span dir="ltr"><<a href="mailto:xrfang@gmail.com" target="_blank">xrfang@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><div></div><div class="gmail_extra"><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p></p>
<p>Short answer: you can't. The same would happen with normal classes.</p>
<p>Long answer: You could add an additional method "Next" to your "TIntTree" which returns a "TIntTree" and just do "Result := TIntTree(inherited Next);" there. <br></p></blockquote>
</div></div></div></div></blockquote><div>I still have problem with this strange issue. See the demo program below:<br><br><span style="font-family:courier new,monospace">program test;<br>{$mode objfpc}{$H+}<br>uses treap;<br>
type<br> TStringMapper = class(specialize TTreap<string, string>)<br> end;<br>var<br> sm1, sm2: TStringMapper;<br> n: TStringMapper.PNode;<br>begin<br> sm1 := TStringMapper.Create;<br> for n in sm1.Reversed do WriteLn(n^.Key); <-- but NOT here<br>
sm2 := sm1.Reversed; <-- error here<br>end.<br><br></span></div><div><span style="font-family:courier new,monospace">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?<br>
<br></span></div><div><span style="font-family:courier new,monospace">Regards,<br></span></div><div><span style="font-family:courier new,monospace">Xiangrong<br></span></div><div><span style="font-family:courier new,monospace"><br>
</span></div><div><span style="font-family:courier new,monospace"> </span></div></div></div></div>