Boost logo

Boost :

From: Nicolai Josuttis (nicolai.josuttis_at_[hidden])
Date: 2000-01-05 04:35:08


If I use <cstddef> of libstdc++-2.90.7
size_t (and probably ptrdiff_t) is
defined in the global namespace.

For example:
> #include <cstddef>
> size_t x;
> std::size_t y;
This little code example gives an error in line 3
(unlike 2) and says: syntax error before `;'

According to the standard this is a bug.
It should only be defined in namespace std.
(as an intermediate solution, having it
 defined in global and std namespace would at least
 allow to compile standard conforming code).

However, looking into source code I see some
stuff inside shadow/stddef.h that seems to handle
this issue in a way that's not obvious for me.
If I insert /shadow into my include search path
it works fine.
BUT, if I include <cstdlib> then
I get the following error (and more):
> /local/gcc/H-libstdc++/include/g++-v3/shadow/bits/std_cstdlib.h: In function `struct std::div_t std::div(int, int)':
> /local/gcc/H-libstdc++/include/g++-v3/shadow/bits/std_cstdlib.h:187: `_div_t' undeclared (first use this function)

I know, shadow is experimental. So probably you know this already.
Any way to let it work right now (or with the current snapshot)?

Best

-- 
Nicolai M. Josuttis          	http://www.josuttis.de/
Solutions in Time        	mailto:solutions_at_[hidden]

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk