#include <iostream>
#include <complex>
using namespace std;
int main(){
complex<double> p;
cin >> p.real() >> p.imag();
}
g++4.7.2 では正常に動作しますが、C++11 ではコンパイルに失敗しました。なんで?
次のエラーメッセージが表示されます。
prog.cpp: In function ‘int main()’:
prog.cpp:7:19: error: no match for ‘operator>>’ in ‘std::cin >> p.std::complex<double>::real()’
フルバージョン: http://ideone.com/M3BhVR