Boost logo

Boost :

From: Martin Weiser (weiser_at_[hidden])
Date: 2002-03-18 06:00:07

Here are some review comments on the Lambda Library.

General evaluation:
* The BLL is a useful library improving the usability of the STL a lot.
Given the language restrictions, I think it's a nearly optimal substitute
for real lambda expressions.

* The library comes with an extensive and well written documentation.

* It is fairly easy to use from the beginning on, even with only a *very*
quick glance at the documentation. However, there are a couple of
pitfalls that become clear only when reading the docs (and not from gcc's
error messages - well, hardly a surprise).

The Lambda Library should be accepted as a Boost library.

Minor comments:
* For passing lambda functors around in own templated code it can be
necessary to obtain the return value of a lambda functor for a given set
of argument types. The necessary type expression can be derived from the
information provided in 5.3.3 "Function objects as targets / The sig
template" and dwelling through some compiler error messages, but should
definitely be documented explicitly. I didn't find such a passage in the
Addidionally, a helper traits class for easier access of the return type
may be a good idea.

* Writing the identity as 0, _1 instead of _1 comes unexpected. Thus
either placeholders should be full fledged lambda functors, or a design
rationale why this is not the case should be given in section 5.1 of the

* I was somewhat irritated about the difference between ref/cref and var
for delayed access to external variables. This should be explained in
more detail.

* In section 3.1 in class plus_1, the call operator is incorrect (missing
pair of parentheses, _i instead of i).

Reviewers approach:
I gave the documentationa an almost complete reading, and played around
with some trivial test cases. Thus I can't comment on the more arcane
features of the library (exceptions, nested algorithms,...).

No problems (after reading the docs) with gcc 2.95.2.

The only look I took at the implementation was for finding the lambda
functors' return type (but failed - given the complexity of the task the
library addresses, this is hardly surprising). Thus I can't comment on
the implementation's quality.

Finally, having gathered some experience with template metaprogramming
when writing part of the View Template Library, I must say I'm quite
impressed by the work of Jaakko and Gary.


Dr. Martin Weiser            Zuse Institute Berlin
weiser_at_[hidden]                Scientific Computing     Numerical Analysis and Modelling

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