Вызов функции у аргумента, переданного в функцию как константная ссылка
struct point
{
public:
point(double x, double y)
{
x_ = x;
y_ = y;
}
const double get_x()
{
return x_;
}
const double get_y()
{
return y_;
}
private:
double x_, y_;
};
point point_to_vector(const point& begin, const point& end)
{
return point(end.get_x() - begin.get_x(), end.get_y() - begin.get_y());
}
VS2010 ругается:
error: the object has qualifiers that are not compatible with the member function
Объясните, что не так.
Источник: Stack Overflow на русском