Boost logo

Boost Users :

From: Faheem Mitha (yg-boost-users_at_[hidden])
Date: 2003-03-20 02:48:23


On Wed, 19 Mar 2003 10:43:17 -0500, Douglas Gregor <gregod_at_[hidden]> wrote:
> On Tuesday 18 March 2003 10:50 pm, Faheem Mitha wrote:

>> Also, the bind documentation itself (again, as far as I can see) does
>> not say anything about how to handle assignments. Therefore, would it
>> not be a good idea to include an example in the bind documentation
>> showing how assignments should be handled? In any case, more and
>> varied examples are always a good thing.
>
> There is an example of using the two libraries together here:
> http://www.boost.org/libs/bind/bind.html#with_boost_function
> but perhaps we need something that says "if you want to store a bind object,
> use Function" instead of "if you want to use Function with bind, you can do
> this (storing a bind object)".

Right. I saw the example you mentioned, but the significance (and
utility) completely passed me by, partly, perhaps, because it was
inside a class, and also because it was not stated explicitly that
this was how you stored boost objects. It would also be good to use an
example with several arguments.

As someone who has done a lot of teaching, I know it is best to keep
examples as simple as possible, while still having the features
necessary to serve its purpose. A lot of free software libraries have
the problem that they give examples that are way too complicated, and
include lots of irrelevant stuff, which just causes confusion. Your
documentation is pretty good, actually.

I think it would be good if it was stated explicitly that

1) The return type of Bind objects is undefined (or whatever).

2) If you want to store a bind object, use boost::function, with a
pointer to the appropriate section. An example with several arguments
would be nice.

Of course, finding the documentation once they have been told (1) and
(2) is the easy part.

I can attest personally that expecting people to read between the
lines (if they are not experts) will not work well in this case.

My apologies if it sounds like I am lecturing you. I am very grateful
for your helpful feedback.

                                                   Faheem.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net