Sign in Join

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

Mailing lists / fpc-devel / 2014-08

Cannot Forward Declare a Generic Class

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

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

Den

Hi there,

Is there a reason why I cannot forward declare a Generic Class?

TSomeClass<T> = Class;
TSomeOtherClass<T> = Class
   Obj : TSomeClass<T>;
End;
TSomeClass<T> = Class
End;

--------------------------------------------------

Yes, I know I could put TSomeClass<T> inside TSomeOtherClass, but there are 2 other classes that back reference each other and it's quite the pain without being able to forward declare the Class. Can this be implemented? I'm tired, so I may not be thinking of the implications of why.. I suppose I'll have to use some good ol' fashioned {$INCLUDE}'s inside the other class.

- Dennis Fehr

Reply by email