Namespace question

Gabriel F. T. Gomes gftg@linux.vnet.ibm.com
Thu Mar 9 02:50:00 GMT 2017


Hi,

While working on a refactoring in glibc's libm, I came across a
question about namespace for some helper functions in math.h.

Each classification macro in math.h, has a type-specific helper
function, for instance __fpclassifyf for float.  We would like to
understand if these functions need to be in a namespace or if, since
they are helper functions, the namespace requirement does not apply.

For instance, is the namespace code in the examples below correct,
required, or even incorrect?

namespace __c99 {
extern int __fpclassifyf (float __value);
extern int __signbit (double __value);
extern int __isinff (float __value);
}

namespace std {
extern int __isinf (double __value);
}

The thread where these question were raised is the following:
https://sourceware.org/ml/libc-alpha/2017-03/msg00123.html

Thank you,
Gabriel



More information about the Libstdc++ mailing list