L
luca regini
I have this code
class M
{
.....
T operator()( size_t x, size_t y ) const
{ ... Operator overloading A ....}
T& operator()( size_t x, size_t y )
{ ... Operator overloading B .... }
}
Then i use the following code
M m;
int i=m(0,0); // Call A
m(0,0)=5; //Call B
I expect "Call A" to cause "Operator overloading A" to be called and
"Call B" to cause "Operator Overloading B" to be called.
What happens under visual studio 7.0 is that Operator overloading B is
always called.
Is this correct?
Thanks in advance,
Luca Regini
class M
{
.....
T operator()( size_t x, size_t y ) const
{ ... Operator overloading A ....}
T& operator()( size_t x, size_t y )
{ ... Operator overloading B .... }
}
Then i use the following code
M m;
int i=m(0,0); // Call A
m(0,0)=5; //Call B
I expect "Call A" to cause "Operator overloading A" to be called and
"Call B" to cause "Operator Overloading B" to be called.
What happens under visual studio 7.0 is that Operator overloading B is
always called.
Is this correct?
Thanks in advance,
Luca Regini