[fpc-devel] Suggestion: reference counted objects

Hans-Peter Diettrich DrDiettrich1 at aol.com
Tue Sep 23 01:58:41 CEST 2014


Boian Mitov schrieb:
> In general, records and classes are inherently the same thing (and in 
> C++ are indeed practically interchangeable).

This model might have been the reason for introducing Object at all, for 
compatibility with CBuilder.

> The only real difference in 
> Delphi/FPC is that records are instantiated in the stack, the objects in 
> the heap,

Like records, Objects can reside in either the stack, heap or even 
static memory.

> and the artificial restriction on record inheritance.

Why inherit when you can't override virtual methods? I convert my 
Records into Objects, when I want to extend an record.

DoDi




More information about the fpc-devel mailing list