Skip to content

Instantly share code, notes, and snippets.

@jasonmc
Created November 3, 2011 01:22
Show Gist options
  • Save jasonmc/1335497 to your computer and use it in GitHub Desktop.
Save jasonmc/1335497 to your computer and use it in GitHub Desktop.
Accessing overloaded ()
#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