Quick Q: Overload resolution between object, rvalue reference, const reference

Quick A: the better match is picked, and an error generated if there none.

Recently on SO:

Overload resolution between object, rvalue reference, const reference

As there is only one parameter, the rule is that one of the three viable parameter initializations of that parameter must be a better match than both the other two. When two initializations are compared, either one is better than the other, or neither is better (they are indistinguishable).

Without special rules about direct reference binding, all three initializations mentioned would be indistinguishable (in all three comparisons)...

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.