fork(8) download
  1. #include <complex>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main(void)
  7. {
  8. complex<int> z(20, 200);
  9. cout << abs<int>(z) << endl;
  10. return 0;
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/complex: In function ‘_Tp std::__complex_abs(const std::complex<_Tp>&) [with _Tp = int]’:
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/complex:579:   instantiated from ‘_Tp std::abs(const std::complex<_Tp>&) [with _Tp = int]’
prog.cpp:9:   instantiated from here
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/complex:558: error: call of overloaded ‘abs(int&)’ is ambiguous
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/cmath:99: note: candidates are: double std::abs(double)
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/cmath:103: note:                 float std::abs(float)
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/cmath:107: note:                 long double std::abs(long double)
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/complex:558: error: call of overloaded ‘abs(int&)’ is ambiguous
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/cmath:99: note: candidates are: double std::abs(double)
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/cmath:103: note:                 float std::abs(float)
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/cmath:107: note:                 long double std::abs(long double)
stdout
Standard output is empty