Advertisement
Guest User

Untitled

a guest
May 24th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include <iostream>
  2. #include <functional>
  3.  
  4. void use_constRef_fun(const std::function<void(void)>& fun) {
  5. fun();
  6. }
  7.  
  8. void foo() {
  9. std::cout << "Foo!" << std::endl;
  10. }
  11.  
  12. int main()
  13. {
  14. use_constRef_fun(foo);
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement