Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Online C++ Compiler.
- Code, Compile, Run and Debug C++ program online.
- Write your code in this editor and press "Run" button to compile and execute it.
- *******************************************************************************/
- #include <iostream>
- using namespace std;
- int b(bool print_state) {
- if(print_state)
- cout << "print state here" << endl;
- return 2;
- }
- int a(decltype(b) ptr_b, bool x) {
- return ptr_b(x);
- }
- int main()
- {
- cout<<"Hello World";
- auto ret = a(&b, true);
- cout << ret << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement