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!
#include <iostream>
#include
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
participants (2)
-
James Pritts
-
Steven Watanabe