What is the namespace for math functions? Global or std?
Consider cos function. It has 3 overloads. But there is also legacy cos from math.
The cXXX headers place all their stuff in the std namespace. They may also put them in the global namespace but it's not required.
This is from C++0x, the upcoming standard, section D.7:
2/ Every C header, each of which has a name of the form
name.h, behaves as if each name placed in the standard library namespace by the correspondingcnameheader is placed within the global namespace scope. It is unspecified whether these names are first declared or defined within namespace scope (3.3.6) of the namespacestdand are then injected into the global namespace scope by explicit using-declarations (7.3.3).3/ [ Example: The header
assuredly provides its declarations and definitions within the namespacestd. It may also provide these names within the global namespace. The headerassuredly provides the same declarations and definitions within the global namespace, much as in the C Standard. It may also provide these names within the namespacestd. —end example ]
This is unchanged from section D.5 from C++03 (it's made more explicit in the newer standard but the effect is the same):
2/ Every C header, each of which has a name of the form
name.h, behaves as if each name placed in the Standard library namespace by the correspondingcnameheader is also placed within the namespace scope of the namespacestdand is followed by an explicit using-declaration.3/ [Example: The header
provides its declarations and definitions within the namespacestd. The headermakes these available also in the global namespace, much as in the C Standard. —end example]
If you include the 'old-style' XXX.h header, it's placed in both namespaces (in both iterations of the standard).