Given a class with  operators for both lvalue and rvalue:
and a function with a const A& as argument
double operator  (unsigned int i)
cout << "rvalue operator" << endl;
double &operator  (unsigned int i) const
cout << "lvalue operator" << endl;
The following lines have the expected behavior:
void theFunc(const A &a)
But I wouldn't have expected this one:
double v = a; // calls the rvalue  operator
a = 10; // calls the lvalue  operator
Obviously, if I cast the argument with something like this
theFunc(a); // calls the rvalue operator ! Why ?
, it works as expected, but I'd rather use a cleaner solution.
Why the rvalue isn't used in that case ?
Does anyone know a solution to this issue ?