Created
November 3, 2011 01:22
-
-
Save jasonmc/1335497 to your computer and use it in GitHub Desktop.
Accessing overloaded ()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Test { | |
public: | |
void operator()(int a) { | |
cout << a << endl; | |
} | |
void function2(int b) { | |
(*this)(b); | |
} | |
}; | |
int main() { | |
Test t; | |
t.function2(4); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment