Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-10

Writing generic enumerator

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

leledumbo

Is it possible to write one? Due to the nature of enumerator, the iterator and iterated class usually form mutual dependency. With normal classes, this is no problem as mutual dependency can be resolved with forward type declaration. But what if it's used with generic classes (and therefore generic enumerator)?

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Writing-generic-enumerator-tp4890642p4890642.html Sent from the Free Pascal - General mailing list .
Sven Barth
to leledumbo
leledumbo wrote 5 lines
Is it possible to write one? Due to the nature of enumerator, the iterator and iterated class usually form mutual dependency. With normal classes, this is no problem as mutual dependency can be resolved with forward type declaration. But what if it's used with generic classes (and therefore generic enumerator)?

I don't know whether I understand your question correctly, but you can take a look at the unit "fgl" which contains a few generic classes and enumerators for them.

Regards,
Sven