D16830: WIP: Tabbar: Add 'File Properties' menu item and three more (Rename, Delete and Compare)
noreply at phabricator.kde.org
Tue Nov 20 22:49:08 GMT 2018
gregormi added inline comments.
> dhaumann wrote in katefileactions.cpp:51
> RAII: here we request a resource without initialization. Correct is:
> bool ok = false;
> Even if the bool is set in the next line via out parameter. Over time the code may change and then we have an uninitialized variable. :)
Thanks for the review! I didn't look at the copied code very closely so far. My bad.
Though "bool ok;" should be corrected, I woudn't call it RAII: https://en.cppreference.com/w/cpp/language/raii says RAII is about acquiring and releasing resources which exist in limited supply like heap memory, file handles etc. Creating a mere stack variable does not fit this description.
To: gregormi, #kate
Cc: dhaumann, mmustac, ngraham, kwrite-devel, michaelh, demsking, cullmann, sars
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the KWrite-Devel