#include <iostream>
#include <complex>
using namespace std;
int main(){
complex<double> p;
cin >> p.real() >> p.imag();
}
In g++4.7.2 it works successfully, but in C++11 failed to compile. Why?
It gives me following error message:
prog.cpp: In function ‘int main()’:
prog.cpp:7:19: error: no match for ‘operator>>’ in ‘std::cin >> p.std::complex<double>::real()’
Full version: http://ideone.com/M3BhVR