
"Christopher Baus"
Ok this is bit off topic since it isn't directly related to boost, but I know there are a lot C++ guru's here, and I'm sure one of you has addressed this.
I am using Andrei's ScopeGuard and not boosts. I have googled, but I haven't figured out how to turn off the "unused variable" warning in g++, with out disabling all warnings. My guess is that there is no solution, but I thought I would try here first.
Joaquín M López Muñoz has a version of Anrei's scope guard in his recently accepted multi_index library. To prevent these warnings, he adds a no-op member void touch() cont { } to scope_guard_impl_base. Then, in his version of ON_BLOCK_EXIT (which is customized for his library, and so not generally useful) expands to something like this: const scope_guard_impl_base& guard = make_guard( ... ); guard.touch(); Jonathan