Default

From Lazarus wiki
Revision as of 18:47, 29 October 2021 by Alextp (talk | contribs) (Created page with "'''Default''' is a compiler intrinsic: it returns for every type T a default value. In essence, this is a block of memory that is zeroed out. It can be used to correctly initi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Default is a compiler intrinsic: it returns for every type T a default value. In essence, this is a block of memory that is zeroed out. It can be used to correctly initialize any type, and more importantly, a managed type. It also works using a generic type template.

This function cannot be used on any of the file types or complex types that contain a file type.

function Default(T: AnyType): AnyType;