Generic constraints
Original Reporter info from Mantis: marco @marcoonthegit
-
Reporter name: Marco van de Voort
Original Reporter info from Mantis: marco @marcoonthegit
- Reporter name: Marco van de Voort
Description:
Delphi allows to specify constraints with generics.
type xx&LtPos;t:constraint1,constraint2> = class ...
Constraints can be classtypes, interfacetypes and special cases "class","record" and "constructor", separated with comma's like interfaces.
Constructor means that the class has a constructor without parameters, and allows generic code to call a constructor on a type T.
Class means that it is a reference type (class or interface), probably important for typecasting relating to inheritance.
record means it is a value type
Mantis conversion info:
- Mantis ID: 20854
- Fixed in version: 3.0.0
- Fixed in revision: 23158 (#4adb36e8)
- Monitored by: » kyan (Constantine Yannakopoulos), » luizamerico (Luiz Americo)