Advertisement
Guest User

Example usage of scope_guards

a guest
May 10th, 2017
704
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.19 KB | None | 0 0
  1. Transaction *t = manager->BeginTransaction();
  2. auto cleanup = make_scope_exit([&] { manager->CloseTransaction(t); });
  3.  
  4. auto logErrors = make_scope_fail([] { LogError(); });
  5. t->Write("Foo");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement