Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-10-10 13:05:51


From: "Jeremy Siek" <jsiek_at_[hidden]>
> P.S. Perhaps we can start thinking about a better model for
> adaptable function objects.

Yes, perhaps we should.

The whole thing boils down to:

1. There is no 'adaptable function object' model that can work given the
current C++:

struct X
{
    template<class T> T * operator()(T &);
};

or, actually, there is, but it's not worth pursuing. :-)

2. There are two problems that need to be solved, and we'll be able to
handle arbitrary function objects without needing a model.

2a. Arbitrary function argument forwarding.

template<class T> void f(T & t);

is close, but not enough.

2b. Return type inference.

typeof. Enough said.

The various lambda libraries (notably the Lambda library) approximate this
functionality very well in (current) C++, but they can't solve the problem
in general. Even _1 << _2 is so disproportionately non-trivial.

--
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