Came across an interesting article about the Curiously Recurring Generic Pattern (CRGP)
(
In the C++ world, where it is called the Curiously Recurring Template Pattern)
Read about it here:
https://blog.grijjy.com/2022/01/25/crgp/A number of Delphi examples are explained on that webpage.
It's for Delphi. Will it also work for Lazarus?The Curiously Recurring Generic Pattern (CRGP) is a pattern where a class TFoo derives from a generic class, using the class TFoo itself as the type parameter.
Attached below are the Delphi examples code.