08/01/25 02:32:53
以下抜粋
1. lvalues can bind to an rvalue reference.
2.
struct A {};
void h(const A&);
void h(A&&);
void g(const A&);
void g(A&&);
void f(A&& a)
{
g(a); // calls g(const A&)
h(a); // calls h(const A&)
}
Although an rvalue can bind to the "a" parameter of f(), once bound, a is now treated as an lvalue.
>>139の言うとおりのような気がする。