I want to make an argument for one of the member functions optional. When no argument is provided, it would use an member variable.
However, when I tried to compil
Besides overloading, another approach is passing an invalid value as the default value. Then check it inside your function.
void Object::MoveTo(double speed, Point position = InvalidPosition) { position = (position != InvalidPosition) ? position : initPos; ... }