Re: [Boost-users] ptrdiff_t

I've check crtdefs.h on my system . It defined ptrdiff_t here but not under std namespace . Is the right place that ptrdiff_t got defined ? If not in which file should ptrdiff_t be defined . Maybe I should search the file where size_t got defined ? thanks in advance
Message: 7 Date: Wed, 23 Jun 2010 10:56:27 +0200 From: Niels Dekker - address until 2010-10-10
To: boost-users@lists.boost.org Subject: Re: [Boost-users] ptrdiff_t Message-ID: <4C21CC3B.30408@xs4all.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Stefan Strasser wrote:
Zitat von yushang:
I'm using boost with VC , when using array.hpp compiler complain the following error: 'ptrdiff_t' : is not a member of 'std' I searched ptrdiff_t definition in all files , found it defined in crtdefs.h which is not in namespace std. But array class has this
#include <cstddef>
array should include it though, if it doesn't please file a bug report: http://www.boost.org/support/bugs.html
ptrdiff_t *is* a member of 'std'. And boost/array.hpp *does* #include <cstddef>. At least at http://www.boost.org/doc/libs/1_43_0/boost/array.hpp
So yushang, do you really think it's a Boost bug?
Kind regards,
Niels -- Niels Dekker http://www.xs4all.nl/~nd/dekkerware Scientific programmer at LKEB, Leiden University Medical Center

I've check crtdefs.h on my system . It defined ptrdiff_t here but not under std namespace . Is the right place that ptrdiff_t got defined ? If not in which file should ptrdiff_t be defined . Maybe I should search the file where size_t got defined ? thanks in advance
This makes no sense to me, which VC++ version are you using, and what compiler options? Boost.Array works just fine for me under VC++ and always has. FYI, ptrdiff_t is defined in crtdefs.h and then imported into namespace std in cstddef - at least it is in VC9. John.

Zitat von John Maddock
I've check crtdefs.h on my system . It defined ptrdiff_t here but not under std namespace . Is the right place that ptrdiff_t got defined ? If not in which file should ptrdiff_t be defined . Maybe I should search the file where size_t got defined ? thanks in advance
This makes no sense to me, which VC++ version are you using, and what compiler options? Boost.Array works just fine for me under VC++ and always has.
most likely you fergot to close a namespace in one of your own headers, which was included before array.hpp (or some other header including <cstddef>). then something that's supposed to be in "std" can end up in "your_namespace::std". try to include all of your headers after standard and boost headers.
participants (3)
-
John Maddock
-
Stefan Strasser
-
yushang