In our previous episode, Sven Barth via fpc-pascal said:
> > function)
> >
> > In such cases, you don't declare it "auto". Just as you don't free a
> > pointer in the function you declare it if you pass the instance to another
> > code that stores it beyond the life time of the function
> >
> 
> But you don't necessarily know that the function you call does that (think
> third party code). And people *will* use this and don't think about the
> consequences. So a system with automatic reference counting is safer and
> that is what is planned, if at all.

Moreover the use case, dynamically instantiated classes with very local
scope is rare.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to