Surya Kiran Gullapalli
As far as I understand it you need to double nest the binds. Using Boost.Lambda it would be something like this:
boost::lambda::bind( &BasePlugin::foo, boost::lambda::bind( &TemplatedClass< BasePlugin >::operator->, t ) )
This expression should give you a boost::function< void ( void ) >.
K
That doesn't seem to be working. I'm getting lot of errors and its next to impossible to comprehend those errors.
I've attached sample files to what I'm trying to do.
Please Help.
Thanks in advance, Surya
You can do it hard way and easy way.
1. Hard way.
fp = boost::lambda::bind
(
&BaseClass::foo,
boost::lambda::bind(&TemplateClass<BaseClass>::operator->, t),
boost::lambda::_1
);
2. Easy way.
a) Add the following to template.h.
namespace boost
{
template<class T>
T * get_pointer(const TemplateClass<T> & p)
{
return p.operator->();
}
}
b) Use boost::bind instead of boost::lambda.
//#include