Boost logo

Boost :

Subject: Re: [boost] [bind] virtual function pointer woes
From: Jon Biggar (jon_at_[hidden])
Date: 2009-01-09 11:47:52

Chris wrote:
> As far as I know, no. If you find a true answer, please tell me.
> I had this problem once as well and looked into it on the newsgroups.
> There may be a non-portable way with the vtable and asm, but not
> generally. My suggestion would be to make a split
> _nv function that does the call
> struct B { virtual void f() { f_nv(); } void f_nv()
> {std::printf("B\n"); } };
> struct D : B { virtual void f() { f_nv(); } void f_nv() {
> std::printf("D\n"); } };
> And then bind _nv;

Or just create a new free function:

inline void call_B_f(D &d)

boost::bind(&call_B_f, _1)(d);

Jon Biggar

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