3 ms·
A kind of Pareto domination criterion is used in C++ for determining overload resolution: which function overload gets the call. The objectives are matching ar
by kazinator 2mo ago
A kind of Pareto domination criterion is used in C++ for determining overload resolution: which function overload gets the call.
The objectives are matching arguments to parameters.
A set of functions is identified among the candidates: those that are possible for the call at all, like having a compatible number of parameters.
Essentially, the overload rule says that the Pareto front set of candidates must contain one member, otherwise the call is considered ambiguous, and diagnosable rule violation.
The objectives being optimized are individual parameter positions, each in the dimension of suitability: being a better match.
One candidate is better than another if it is no worse a type match in every parameter, and strictly better in at least one parameter.