The File class leaks memory if deleted without calling close(). A simple DTOR which handles closing the file when the object is deleted would solve this problem. This would then require handling of move-assignment and move-construction. Additionally, this class should not be copyable (simply deleting the copy constructor and copy assignment operator would solve this). If desired, I can provide a patch to do all of the above.
The
File
class leaks memory if deleted without callingclose()
. A simple DTOR which handles closing the file when the object is deleted would solve this problem. This would then require handling of move-assignment and move-construction. Additionally, this class should not be copyable (simply deleting the copy constructor and copy assignment operator would solve this). If desired, I can provide a patch to do all of the above.