#include <string>
void f(std::string&& rref){
}
void f(std::string s){
}
int main() {
std::string s = "s";
f(std::move(s));
}
Run Code Online (Sandbox Code Playgroud)
这段代码引起歧义,我不知道为什么,我可能会明确转换为右值引用.
我的想法是rvalue引用可以隐式转换为lvalue.但我不确定.请解释.