Can't compile overloaded class operator wth TNT include


hi all,

trying use tnt (template numerical toolkit) include files in of c++ code. in 1 of files class operator 'sign' overloaded:

"inline double sign(double a)
{
return (a > 0 ? 1.0 : -1.0);
}

inline float sign(float a)
{
return (a > 0.0 ? 1.0f : -1.0f);
}
"

when try use include compiler (g++ command line) gives following error:

"
/usr/include/tnt/tntmath.h: in function 'float tnt::sign(float)':
/usr/include/tnt/tntmath.h:65: error: declaration of c function 'float tnt::sign(float)' conflicts with
/usr/include/tnt/tntmath.h:58: error: previous declaration 'double tnt::sign(double)' here
"

ideas?

thanks,
sckasx
 

i think file in including being compiled c compiler, not c++ compiler.
 


Forums Macs Mac Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments

Popular posts from this blog

Powerbook G4 power issue

Koolaid

Apple Script