This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

<math.h>


According to 26.5p5 <cmath> contains, among other, the function
  double std::abs(double)

D.5p2:
Each C header, whose name has the form name.h, behaves as if each name
placed in the Standard library namespace by the corresponding cname is
also placed within the namespace scope of the namespace std and is
followed by an explicit using-declaration (7.3.3)

Does this, taken together, imply that the call to abs in the program below
calls std::abs(double) ?

If this is the case it seems as if we would have to overload math.h,
otherwise the C++ standard is quite unclear but would probably need to
include that only functions from the C subset should be included.

#include <math.h>
int main()
{
  abs(-1.0);
  return 0;
}


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