> On Jul 16, 2018, at 7:02 AM, Sven Barth via fpc-pascal 
> <fpc-pascal@lists.freepascal.org> wrote:
> 
> Might come, though not in that way (take your example: what if you pass the 
> instance to some other code that stores it beyond the life time of the 
> function) 

That’s what you guys said about my awesome “stack alias” idea. :) Seriously 
though I don’t for the life of me understand why programmers can’t be trusted 
to not do this. You can pass dangling pointers since forever but no one is 
asking pointers to be removed because they’re too dangerous.

Auto is a good idea. Allocating the “auto” classes the memory backend on the 
stack (my “stack alias” idea) is even better because you don’t need the memory 
manager too be involved.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to