The following code with VS2010 prints 0
, contrary to my expectations:
#include <complex>
#include <iostream>
using namespace std;
int main(void)
{
complex<int> z(20, 200);
cout << abs<int>(z) << endl;
return 0;
}
It works fine when the type is double
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…