I know it is same but why no error on the line: for n in sm1.reversed...
regards. 在 2013-9-24 下午11:23,"Sven Barth" <pascaldra...@googlemail.com>写道: > Am 24.09.2013 17:14, schrieb Xiangrong Fang: > > 2013/9/24 Sven Barth <pascaldra...@googlemail.com> > > >> How is PNode declared? What is the exact error? >> >> > PNode is declared inside TTreap generic class, the source is here: > > https://github.com/xrfang/fpcollection/blob/master/src/units/treap.pas > > The exact error is: > > Error: Incompatible types: got > "TStringMapper.TTreap$AnsiString$AnsiString" expected "TStringMapper" > > The error is exactly the same as the one in your TIntTree, because the > return type of TTreap<String, String>.Reversed is TTreap<String, String> > and nothing else. Thus the solution is the same as for TIntTree.Next: > either none or a new "Reversed" function. And again: This problem would > also occur with non generic classes. > > Regards, > Sven > > _______________________________________________ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal >
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal