Auto-destructors
Original Reporter info from Mantis: FPCCore
-
Reporter name: FPC core team
Original Reporter info from Mantis: FPCCore
- Reporter name: FPC core team
Description:
Absence of automatic construction/destruction of classes is very painfull and it can significantly degrade the development process (i.e. smart pointers and RAII are impossible). It's one of the greatest flaws of Pascal relatevly to C++ (the second thing are Templates of cource). Are there any plans for serious language extensions in this way for "post 2.0" releases of FPC ?
P.S. The simpliest proposal for syntax for auto construction/destruction could be like (maybe with some restrictions on constructors/destructors):
Procedure Something;
Var T:tMyClass;Auto;
Begin <- T auto created here
...
If ... Then Exit; <- T auto destructed here
...
End; <- T auto destructed here
Additional information:
Reporter: Sergey Kosarevsky
EMail: netsurfer at land dot ru
Mantis conversion info:
- Mantis ID: 5304
- OS: All
- Version: ?
- Monitored by: » Joe (Joe Merten)