How to ensure, in C++, that a given action is reverted before leaving the function?
Here’s the context. I’m working on a Qt application that draws stuff. At some point, the logic may require to perform a rotation or a translation of the scene in order to draw specific objects, given that this rotation and/or translation should necessarily be reset before drawing other objects.