
Rob Stewart wrote:
From: "Andrey Semashev" <andysem@mail.ru>
Rob Stewart wrote:
From: "Andrey Semashev" <andysem@mail.ru>
I've not looked at anything else, but I thought I'd address these:
- The naming of arm/disarm methods of scope guard. They are used to change the activity status of the guard. Personally, I feel fine with them but the commonly used name for disabling the guard is "dismiss" and I just can't figure out its suitable counterpart in English. I wonder if anyone have a proposal about this.
"Dismiss" would be the right word in English to tell the guard to go away and do nothing more.
Yes but what about its antipod - a function to enable the guard? Note that the guard may even be initially disabled (that's another reason I didn't like dismiss) and then it may be enabled in some place.
I see. I thought you somehow knew of "dismiss" in another language and didn't know the English word for it.
I think Markus is right: summon is the opposite of dismiss for a guard. The question is whether it reads well when used:
guard g; if (something) g.dismiss(); ... if (whatever) g.summon();
"Guard"? Somehow "Summon" doesn't read very well above. I'm sorta partial to guard, but this may cause confusion with both the class name and the namespace name? scope_guard g; if(cond) g.dismiss(); ... if(cond2) g.guard(); Just a thought... -- /Brian Riis