[fpc-pascal] Automatic objects
Marco van de Voort
marcov at stack.nl
Fri Aug 4 18:22:05 CEST 2006
> Marco van de Voort wrote:
>
> > The space of the object is cleaned. However if the object uses dyn memory,
> > you will have to call the destructor (destroy) to make the object cleanup.
> >
> > In general it is considered a good custom to destroy them.
>
> So no C++-style automatic deallocation (the destructor is called
> automatically) is done?
No. Note that most local objects in C++ are strings and the like, but
strings and dynamic arrays are already first tier datatypes in FPC and
automatically managed.
> If not, do neither classes nor objects provide such functionality?
No. For classes it doesn't make sense anyway, since in the code a reference
could be passed to a different structure.
More information about the fpc-pascal
mailing list