Operator Overloading problem
Hi
following piece of code gives error under g++. #include<iostream> using namespace std; class A { public: int operator()() const; operator int() const; }; int A:perator()() const { return 0; } int A:perator int() const { return 0; } int main() { return 0; } Error Message:- undefined.cpp:16: return type specified for `operator int' undefined.cpp:22:2: warning: no newline at end of file :confused: |
Quote:
Remove it and the code will compile. |
All times are GMT -5. The time now is 08:15 PM. |