4 ms·
no, those are absolutely not fixes: you have to remember to use "using", "with", etc. whereas you have to go out of your way to circumvent RAII
by jcelerier 4y ago
no, those are absolutely not fixes: you have to remember to use "using", "with", etc. whereas you have to go out of your way to circumvent RAII
- baq 4y agoNon-issue. You can use fopen in C++ and remember to fclose, too.
- jcelerier 4y agoNo, every time you have something that sound like "you just have to [...]" it means future bugs that were entirely preventable. The only correct way in c++ is to wrap it in a unique_ptr or handle type so that fclose gets called automatically when you are done with the resource
- pjmlp 4y agoUse static analysers, just like you have to do on C and C++ to handle many of their flaws.