On 12/05/16 10:35, Jean-Michaël Celerier wrote:
On Wed, May 11, 2016 at 9:56 PM, Nikos Chantziaras <rea...@gmail.com
<mailto:rea...@gmail.com>> wrote:
This results in code duplication, since you write the same cleanup
code everywhere.
I'd argue that if you use RAII and have cleanup code in more than one
place, you are not using RAII.
But could you give an example of this ?
SCOPE_GUARD { foo; bar; baz }
...
SCOPE_GUARD { foo; bar; baz }
...
SCOPE_GUARD { foo; bar; baz }
etc :-)
Scope guards are useful for one-off things, not for cleanup code you
would need to write over and over again.
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest