Rvalues of class types are not const
as you might think. The const
overload will be called on const
qualified objects, but otherwise the least qualified version is preffered.
What you can do is overload with ref-qualifiers (C++11 only):
float operator()(int, int) && const; // called when object is rvalue
float& operator()(int, int) &; // called when object is lvalue