Difference between revisions of "Template:Object Types"
From Lazarus wiki
Jump to navigationJump to searchm |
m |
||
Line 43: | Line 43: | ||
| Managed Types only | | Managed Types only | ||
| All fields | | All fields | ||
+ | |- | ||
+ | | | ||
+ | :Default() function | ||
+ | | Zeros out all fields | ||
+ | | Zeros out all fields | ||
+ | | Zeros out all fields | ||
+ | | returns nil for | ||
|- | |- | ||
| Operator overload (global) | | Operator overload (global) |
Revision as of 20:49, 18 February 2021
Feature | Record | Adv Record | Object | Class |
---|---|---|---|---|
Encapsulation (combining data and methods + hiding visibility) | No | Yes | Yes | Yes |
Inheritance | No | No | Yes | Yes |
Class constructor and destructor | No | Yes | Yes | Yes |
Polymorphism (virtual methods) | No | No | Yes | Yes |
Memory allocation | Stack | Stack | Stack | Heap (Only) |
|
Managed Types only | Managed Types only | Managed Types only | All fields |
|
Zeros out all fields | Zeros out all fields | Zeros out all fields | returns nil for |
Operator overload (global) | No | Yes | Yes | Yes |
Operator overload (in type only) | No | Yes | No | No |
Type helpers | No | Yes | No | Yes |
Virtual constructors, class reference | No | No | No | Yes |
Variant part (case) as c/c++ union | Yes | Yes | No | No |
Bitpacked (really packing) | Yes | Yes | No | No |
Modified from https://forum.lazarus.freepascal.org/index.php/topic,30686.30.html (original author: ASerge).