Boost logo

Boost :

From: Gary Powell (Gary.Powell_at_[hidden])
Date: 2001-03-19 11:43:27


>>
> I've been thinking about splitting my expression.hpp into bind.hpp and
> expression.hpp as well. Let me outline some of the ideas I've been toying
> with:
>
> bind(f); // gives a library-compatible function object //
> case 1
>
> bind(&Class::member); // ditto, works with Class &, Class *,
> shared_ptr<Class>, variant<Class>, etc as a first argument. // case 2
>
> bind(f, _2, _1); // lambda(x, y, ...) := f(y, x); // case 3
>
> bind(f, 4, _, 5); // lambda(x, y, ...) := f(4, x, 5); // case 4
>
> bind(_, 1, 2); // labmda(x, ...) := x(1, 2); // case 5
>
> bind.hpp, however, is doable
> (in theory.)
>
> I think that we should propose a common interface, to give people a chance
> to implement it for the platform they are interested in.
<<
I think I can speak for Jaakko and I here, and that is yes a common
interface would be fine. That's part of the reason we broke the LL library
into the various sections.

I think the other case you are missing is
bind(&className::MemberFn, classReference/Pointer, arguments);

as in bind(&data::foo, f, 1, 2) ==> f->*foo(1,2); // case 6

The only other case we don't handle this way is case #2. I'm not sure I
understand what you intend the result of this call to bind to be.

And that the naming convention for the "free" args that the two libraries
use is different. (LL has a typedefs for the free args so this isn't much of
an issue for LL.)

And yes, that's part of what we did with the "boostification" break the
source code down into boost::bind::details namespace and boost::bind
iterfaces.

  -gary-

gary.powell_at_[hidden]


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