While I was studying rvalue reference, I found a strange answer from stackoverflow.
Here is a modified code :-
void foo(X& x) { } //#A
void foo(X&& x) { foo(x); } //#B
Why doesn't this lead to stack overflow exception?
Why foo#B call foo#A, but not foo#B?
More specifically, which C++ rule enforces this behavior?
Aucun commentaire:
Enregistrer un commentaire