Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. const Parm parm_;
  2.  
  3. Parm &parm_;
  4.  
  5. const Param &param_;
  6.  
  7. int foo();
  8.  
  9. int& i = foo();
  10.  
  11. void my_exit(const std::string & msg)
  12. {
  13. std::cout << "my_exit: " << msg << std::endl;
  14. }
  15.  
  16. void test()
  17. {
  18. std::string msg("test_1 Hello World");
  19. ON_BLOCK_EXIT(&my_exit, msg.substr(0, 6));
  20. }
  21.  
  22. void test()
  23. {
  24. std::map<int, std::string> m;
  25. m[42] = "test_2";
  26. ON_BLOCK_EXIT(my_exit, m[42]);
  27.  
  28. m.clear();
  29. }
  30.  
  31. void test(const std::string & msg)
  32. {
  33. ON_BLOCK_EXIT(&my_exit, msg);
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement