abs function question

Gabriel Dos Reis gdr@integrable-solutions.net
Tue Jul 29 14:35:00 GMT 2003


Nathan Myers <ncm-nospam@cantrip.org> writes:

| It would be an unfortunate choice to use ::abs, generally, because in
| C it's not going to be defined inline.  In C there's generally a macro 
| abs() hiding it, which we have to #undef because it doesn't scope.  
| Leaving it undeclared in their header allows C++ to define both ::abs 
| (extern) inline and std::abs aliased to it, or vice versa.

This approach assumes we have a control over the host C library --
something we generally don't.

-- Gaby



More information about the Libstdc++ mailing list