Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <functional>
- void use_constRef_fun(const std::function<void(void)>& fun) {
- fun();
- }
- void foo() {
- std::cout << "Foo!" << std::endl;
- }
- int main()
- {
- use_constRef_fun(foo);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement