Support for default(<type>) function
Original Reporter info from Mantis: tom_at_work
-
Reporter name: Thomas Schatzl
Original Reporter info from Mantis: tom_at_work
- Reporter name: Thomas Schatzl
Description:
For implementing some functionality using generics it is required that the compiler provides a default() (or similar) function which returns a default value for a particular type.
E.g. consider having a generic map (dictionary) and some hypothetic method
function Find(const key: TKey; out data : TData) : Boolean;
(searches for the data value assigned to given key; assigns it to data if found, and returns true, assigns some "default" value and returns false otherwise)
within this function it is not possible to assign some useful value to data although "out" parameters require this.
Mantis conversion info:
- Mantis ID: 9420
- Version: 2.3.1
- Fixed in version: 3.0.0
- Fixed in revision: 20629 (#bd19a16b)
- Monitored by: » Basil Peace (Basil Peace), » kyan (Constantine Yannakopoulos), » @martin_frb (Martin Friebe)
- Target version: 3.0.0
- FPCTarget: 2.4.0