Boost logo

Boost Users :

Subject: Re: [Boost-users] template concept question
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-03-08 21:35:27


AMDG

Alan Tennant wrote:
> I was reading about boosts concepts and I thought.
>
> Can I ask inside a template function if a member exists on a parameter of
> the function.
>
> For example.
>
> template <typename T>
> void func(T in)
> {
> exists(in, foo);
> }
>
> Where the "exists" line would return true if "in" had a member "foo"
> otherwise false.
>

There's an introspection library in the sandbox that
does this, I think. http://svn.boost.org/svn/boost/sandbox/introspection

In Christ,
Steven Watanabe


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