« Return to Thread: detect if a type has a size_t member

Re: detect if a type has a size_t member

by Mathias Gaunard-2 :: Rate this Message:

Reply to Author | View in Thread

Hicham Mouline wrote:

> #include <boost/introspection/has_member_data.hpp>
>
> struct S {
>   static const size_t maxsize =5;
> };
>
> struct T {
> };
>
> BOOST_HAS_MEMBER_DATA(S, maxsize)
> BOOST_HAS_MEMBER_DATA(T, maxsize)

It's not BOOST_HAS_MEMBER_DATA you need, but BOOST_HAS_STATIC_MEMBER_NAMED.

Indeed, BOOST_HAS_MEMBER_DATA is for non-static members.

_______________________________________________
Boost-users mailing list
Boost-users@...
http://lists.boost.org/mailman/listinfo.cgi/boost-users

 « Return to Thread: detect if a type has a size_t member