I have a problem where I want to overload 2 functions by swapping the default parameters to make it possible to swap them in a call.
Create(UncachedGraph* graph, std::string name, Node* parent, std::string path = "", int pos = -1);
Create(UncachedGraph* graph, std::string name, Node* parent, int pos = -1, std::string path = "");
but the problem is that if you call it without passing any arguments to default parameters, the call is ambiguous
Create(this->graph, this->node->getName(), this->node->getParent()); // Create(graph, name, parent) is ambiguous since the overload to be called cannot be resolved
and I understand why it is like that. But I would really love to somehow resolve it by prioritizing one overload over another by some rule, like for example with some "magic qualifier"
prioritized Create(UncachedGraph* graph, std::string name, Node* parent, std::string path = "", int pos = -1);
Create(UncachedGraph* graph, std::string name, Node* parent, int pos = -1, std::string path = "");
which in the above call would resolve the ambiguity by calling the first overload, or something else. The thing is, in this case I simply do not care which of the overloads is being called, because there they are just the same.
So, is there any possible thing I can do to resolve this problem?