|
From: Marc H. <ma...@e-...> - 2003-07-28 17:14:04
|
Hi All,
I am developing a class for use as a type. So let's imagine the following
scenario (this example is contrived and not useful in any way, but it
shorter than the code for my class):
class CNumber
{
public:
CNumber(int n = 0) : m_n(n) {};
virtual ~CNumber() {};
unsigned char operator()()
{
return (unsigned char) m_n;
};
long operator()()
{
return (long) m_n;
};
private:
int m_n;
};
Compiling this tells me that the () operators cannot be overloaded! If I
remove one of them, then it compiles just fine. Are you going to tell me
that I can only overload the () operator once?
__________________________________
Marc Heiligers
|