
16 Jul
2008
16 Jul
'08
5:20 p.m.
AMDG Robert Jones wrote:
Is it possible to bind to pure virtual methods? Like this
<snip>
My compiler seems to be complaining that s is abstract, which is surely not a real limitation!
This is a unfortunate problem with Boost.Lambda's return type deduction mechanism. See also http://svn.boost.org/trac/boost/ticket/426. You can work around it by passing a pointer. #include <boost/lambda/bind.hpp> #include <boost/lambda/lambda.hpp> struct S { virtual void methodOfS() = 0; }; void f( S & s ) { using namespace boost::lambda; bind(&S::methodOfS, _1)(&s); } In Christ, Steven Watanabe