-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Mathias Gaunard Sent: 29 July 2009 15:48 To: boost-users@lists.boost.org Subject: Re: [Boost-users] detect if a type has a size_t member
Hicham Mouline wrote:
Nevertheless, I still couldn't figure out how to detect the static const size_t member.
Which version to use?
No version allows this at the moment. You may, however, try to simply duplicate HAS_STATIC_MEMBER (or whatever it's called), change &X::Name to X::Name, and Type* to Type.
Thanks very much, It worked for me on vs2005 and g++4.3.3 http://codepad.org/wsNi21Pr at least for the cases I wanted, that is struct S1 { static const size_t maxsize= 5; }; struct S5 { }; Nevertheless, it failed to compile on g++4.3.3 for struct S2 { static size_t maxsize; }; because of this error: error: 'S2::maxsize' is not a valid template argument for type 'long unsigned int' because it is a non-constant expression but compiled on vs2005 and failed ( which I don't care about ) thanks again,