Boost logo

Boost Users :

Subject: Re: [Boost-users] detect if a type has a size_t member
From: Hicham Mouline (hicham_at_[hidden])
Date: 2009-07-03 13:53:33


> -----Original Message-----
> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
> bounces_at_[hidden]] On Behalf Of joel
> Sent: 03 July 2009 17:03
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] detect if a type has a size_t member
>
> Hicham Mouline wrote:
> > Hello
> >
> > template <typename T>
> > struct S {
> > // how to detect T has a member static const size_t value ?
> > // if T has value, define member of S, m1 of type T1, otherwise
> m2 of
> > type T2
> > };
> >
> > Regards,
>
> Check the Boost.Vault for th eintrospection library. It has a
> HAS_STATIC_MEMBER_NAMED meta-function builder

Can I put the macro inside the struct S ? I guess not. I'd write:

HAS_STATIC_MEMBER_NAMED(T, value)

which would return a integral bool or a bool type?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net