std::size_t and std:

trdiff_t are defined in <cstddef>.
I've noticed that a bunch of old math function in the global namespace
are undefined in <cmath> and they are redefined in std namespace.
I'm wondering why ::size_t and :

trdiff_t aren't undefined.
Thanks,
Peng
When you include any of the 18 C standard headers that are included in
the C++ standard, you can do so in two ways:
#include <stddef.h>
....or:
#include <cstddef>
This applies to every one of the C headers.
When you include a C header the first way, the same way as you would
in C, the C++ standard requires that each identifier that can be
scoped be defined in both the global and std namespace.
When you include a C header the second way, that is 'c' in front and
without the ".h" at the end, the C++ standard requires that each such
identifier be defined in the std namespace only, and not in the global
namespace.
The issue here is that this particular requirement of the C standard
is not highly regarded by many. Quite a few compiler vendors put some
of all of the C identifiers in the global namespace even when the
headers are included with the preferred C++ syntax. They think they
will get too many complaints from user about breaking existing code.
There is another possibility. The C++ standard allows any standard
header to include any other standard headers. There are, or at least
have been, some C++ implementations where some C++ standard headers
include C headers, often stddef.h, with the C syntax, thus putting
those names into the global namespace.
Technically, this is a violation of the standard, but it is unlikely
to get much attention from the implementers.