With the following:
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ifstream f;
ifstream g;
f = std::move(g);
}
Why is ifstream::operator=(const ifstream
&)
being called instead of ifstream::operator=(ifstream
&&)
even though std::move()
is called?
Update: Generally speaking, is there a way to coerce a lvalue reference to a rvalue reference?