A comment there mentioned this post on code central (archived). It’s about a StringList value class which frees you of the additional code necessary for creating and freeing a TStringList, so you can e.g. have a function that returns one without leaking memory. Interesting stuff by Janez Makovsek (who back then worked for Dew Research, no idea if he is still there)
StringList is the same as TStringList except that it is a value
type. It does not have to be created, destroyed or put within
try/finally. This is done by the compiler for you. There are
virtually no special performance penalties for these to work:var strings: StringList; astr: string; begin strings.Add('test1'); strings.Add('test2'); aStr := string(strings); RichEdit.Lines.AddStrings(strings); end;
The code can be used as a template to wrap any TObject as a value class type.