This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

abs(int) missing


hi,
it seems to me that abs(int) is missing from std namespace!!!
-----------------------
#include <cmath>

int main()
{
  int i = std::abs(4);
  return 0;
}
-----------------------
[lfarkas@garfield:/home/lfarkas/tmp]g++ -fhonor-std test.cpp 
test.cpp: In function `int main ()':
test.cpp:5: call of overloaded `abs (int)' is ambiguous
/usr/include/g++-v3/bits/std_cmath.h:52: candidates are: float std::abs (float)
/usr/include/g++-v3/bits/std_cmath.h:262:                 double std::abs
(double)
/usr/include/g++-v3/bits/std_cmath.h:362:                 long double std::abs
(long double)

any tipp ?

 -- Levente
 "The only thing worse than not knowing the truth is
  ruining the bliss of ignorance."

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]