Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-11-13 14:33:16


From: "David Abrahams" <david.abrahams_at_[hidden]>
> Hi Peter,
>
> What do I need to do in order to compile this, or something with
equivalent
> functionality, on VC6?
>
> Thanks,
> Dave
>
> ----
>
> struct X
> {
> int f(void*, double);
> };
>
> template <class A1>
> int call(void* obj, int (X::*f)(void*, A1), A1 a1)
> {
> boost::bind(
> boost::bind(f, _1, _2, a1),
> static_cast<X*>(obj),
> obj);
> }
>
> int ff(void* obj, double other)
> {
> return call(obj, &X::f, other);
> }

This time you need the <int> on the outer bind (since the first parameter is
a function object.) Such is life on MSVC (pre-7.1 ;-) ).

--
Peter Dimov
Multi Media Ltd.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk