Extend the TList to add it this feature. It's easy. Then use the extended version where necessary, and the regular version when not.
Just add the objCount field, and increase it and decrease it on every Add or Remove command.
Doing so, there's no need to change the count() routine.
Just add the objCount field, and increase it and decrease it on every Add or Remove command.
Doing so, there's no need to change the count() routine.