具有以下内容:
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ifstream f;
ifstream g;
f = std::move(g);
}
为什么ifstream::operator=(const ifstream
&)
被调用而不是ifstream::operator=(ifstream
&&)
即使std::move()
被调用?
更新:一般来说,有没有办法将左值引用强制为右值引用?