#include <complex>
using Complex = std::complex<double>;
using Byte = unsigned char;
auto operator*(Byte const b, Complex const& c)
-> Complex
{ return Complex(b)*c; }
#include <iostream>
using namespace std;
auto main() -> int
{
Byte const b = 42;
Complex const c = {2, 3}; // 2 + 3*i
cout << b*c << endl;
}
为什么此代码无法在Visual Studio 2010中编译?
我试图编译它ideone.com,它运行良好,但在视觉它不求上进。
一些C++ 11个功能可能不会出现在2010年 – Ben
能否请您包括错误信息在你的问题,而不是链接到一个屏幕截图? –