Boost logo

Boost :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-07-16 13:20:05


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

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

Boost list run by bdawes at, gregod at, cpdaniel at, john at