Boost logo

Boost :

From: Rene Jager (renej_at_[hidden])
Date: 2001-05-03 14:53:41


Peter Dimov wrote:

> From: "Geurt Vos" <G.Vos_at_[hidden]>
>
> > BTW, about bind, I haven't really looked into it all,
> > but how 'complex' is it going to be? Consider the
> > following example:
> >
> > class C {
> > public:
> > void Func(int,int,int);
> > };
> >
> > int main()
> > {
> > C c;
> > boost::function<void,int,int> f;
> > f = boost::bind<1>(&C::Func,c,100);
> > f(1,2); // will call C::Func(1,100,2)
> > }
> >
> > Can bind do this or similar or is it too much?
>
> The current "bind" in lambda can (AFAIK) do this, although the syntax is a
> bit different:
>
> bind(&C::Func, c, free1, 100, free2);
>
> My favorite syntax for this is
>
> bind(&C::Func, c, _, 100, _);

but this won't let you alter sequence; using named "free" arguments would
allow:

    bind(&C::Func, c, free2, 100, free1);

however, I don't know if this supported by the LambdaLibrary; I guess it
is...

renej

>
>
> --
> Peter Dimov
> Multi Media Ltd.
>
> To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


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