Boost logo

Boost Users :

Subject: Re: [Boost-users] static reflection
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-09-17 22:15:17


AMDG

James Pritts wrote:
> On a boost thread a while ago, I saw some code to query for the
> existence of a member function of a class using SFINAE and
> BOOST_STATIC. I guess you could call it static reflection. Below is
> a code snippet that does not work using the aforementioned methods.
> The culprit is the using Base::operator() statement in the Derived
> class. Apparently the base class method void operator()(float u) is
> not part of the type of Derived. This was a shock to me, because you
> can call the overloaded method from the derived class. I'd appreciate
> any advice on how to check for the existence of member functions in
> this scenario. I fear it may be impossible. Thanks!
>

You can convert a member function pointer of a derived class
to a member function pointer of a derived class, so it ought to work.

What compiler are you using?
I get

1
1

Using msvc 9.0.

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