fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class C
  5. {
  6. public:
  7. void operator()() { cout << "op()\n"; }
  8. void operator()(int) { cout << "op(int)\n"; }
  9. };
  10.  
  11. int main() {
  12. // your code goes here
  13.  
  14. C c;
  15.  
  16. c();
  17.  
  18. c(42);
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
op()
op(int)