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


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

Re: Where is C++'s math.h's double abs(double)?


Gabriel Dos Reis wrote:
> 
> | " 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 header is
> | also placed within the namespace scope of the name-space std and is followed
> | by an explicit using-declaration (7.3.3) 3

Using declarations import names, not specific overloads. It follows that
all overloads of a function declared in namespace std in <cmath> also
appear in the global namespace in <math.h>.

> 26.5/2
> 
>    The contents of these headers [<cmath> and <cstdlib>] are the same
>    as the Standard C library headers <math.h> and <stdlib.h>, with the
>    following additions:
> 
> (The note in bracket in my addition.)  Tha pretty much makes it
> crystal clear that <xxx.h> contains *less* than <cxxx>.

No, it only makes it clear that the <xxx.h> in the C standard contains
less than the <cxxx> in the C++ standard. It makes no such implication
about the <xxx.h> in the C++ standard.

-- 
Ross Smith <ross.s@ihug.co.nz> The Internet Group, Auckland, New Zealand
========================================================================
        "Hungarian notation is the tactical nuclear weapon of
         source code obfuscation techniques." -- Roedy Green


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