Recent

Author Topic: Curiously Recurring Generic Pattern (CRGP)  (Read 403 times)

Boleeman

  • Hero Member
  • *****
  • Posts: 1118
Curiously Recurring Generic Pattern (CRGP)
« on: March 10, 2025, 03:39:14 am »
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.

 

TinyPortal © 2005-2018