This is the mail archive of the
mailing list for the libstdc++ project.
Re: abs function question
On Tue, Jul 29, 2003 at 04:35:28PM +0200, Gabriel Dos Reis wrote:
> Nathan Myers <email@example.com> 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.
Of course we don't have control over every host C library. Sometimes,
though, the vendor has done something helpful, generally on behalf of
their native C++ implementation (HP has one, of sorts.) Where they
did, we can take advantage of it, given a patch from somebody who
cares enough to make one.