Boost logo

Boost Users :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-07-22 12:37:23


"Christopher Baus" <christopher_at_[hidden]> wrote in message
news:34024.66.215.139.141.1090474786.squirrel_at_mail.baus.net...
> 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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net