Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2005-09-22 14:37:17


From: "Jeff Flinn" <TriumphSprint2000_at_[hidden]>
>
> scope_guard g;
>
> if (a) at_ease(g);
> ...
> if (b) attention(g); // emphasizing the appropriate syllables!

Interesting. "At ease" avoids the notion that "dismiss" raises
of the guard no longer being around. It suggests that the guard
isn't paying attention.

Unfortunately, I don't think "at_ease" reads all that well in the
code. One usually doesn't tell code to "take it easy" or "chill"
for a while, at least not in so many words. It just sounds
strange to me.

So, if you choose to keep "dismiss," which really does seem like
a nice choice, what is a good antonym? An interesting near
antonym is "muster:"

   scope_guard g;
   if (a) g.dismiss();
   ...
   if (b) g.muster();

A variation on "guard" (the verb) is "protect," which has the
right meaning and avoids overloading the word "guard" to excess:

   scope_guard g;
   if (a) g.dismiss();
   ...
   if (b) g.protect();

"Secure" is another choice.

-- 
Rob Stewart                           stewart_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk