Delphi: (ab?)using managed types to help guarantee initialisation of stack record (via: Stack Overflow)
The Wiert Corner – I mentioned Delphi managed types is in Delphi “Variant Records”, a few notes indicating they are special. Managed by the RTL, you can use them to your advantage when you have record types that – when on the stack – are only partially initialized by the RTL: only the managed types are initialized. Given there is still no support to support “Initialize” and “Finalize” operators (vote for it on QualityCentral) the best you can do was mentioned by LU RD (an alias a very smart Swedish guy Leif Unéus): Add a dummy string member into your record. Since a string is ...
Visits by Source
Users who voted for this posting