Re: [boost] [SPAM] Re: [scope_guard] New revision available + naming consideration

22 Sep
2005
22 Sep
'05
8:08 p.m.
You're missing the usage of wanting to keep the original undo behavior, ignore it in some portion of the code, and then reinstate it later. With the above, it appears that would entail this sort of usage:
scope_guard g(my_undo_function); ... g = scope_guard(); ... g = scope_guard(my_undo_function); ...
That introduces a maintenance problem. With the names we're discussing, you'd write this instead:
scope_guard g(my_undo_function); ... g.dismiss(); // or whatever name is selected ... g.protect(); // or whatever name is selected ...
Ok, I can see that. I like the latest suggestion of dismiss/protect. abandon might be another possiblity for dismiss and seems to go with protect. Jason Stewart
7205
Age (days ago)
7205
Last active (days ago)
0 comments
1 participants
participants (1)
-
Jason Stewart