Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-08-17 07:06:27


From: "Ross Smith" <ross.s_at_[hidden]>
> The documentation doesn't mention mem_fun, so the reader has no way of
> guessing what's going on here short of delving into the implementation.

"Using bind with member function pointers

bind accepts pointers to member functions as its first argument. The library
uses boost::mem_fun to convert them into function objects: "

(where 'boost::mem_fun' is a hyperlink to

http://www.mmltd.net/pdimov/mem_fun.html

)

> In any case, I repeat my suggestion that this needs more documentation.

Noted.

> > In my experience, the _1 notation really stands out and is not easily
> > confused with either 1 or -1.
>
> I disagree. Very strongly. Very, very, _very_ strongly.

Noted. :-) Although with syntax coloring on you'd have to be color blind to
confuse the two.

> > I'm willing to take the risk. Nobody is safe from macros (pascal, min,
> > Sleep.) Of course if someone does report a conflict, _bi will change.
>
> Couldn't you at least make the trivial change to trailing underscores
> instead of leading ones? It doesn't make the names any longer, and it
> avoids all the implementation namespace problems.

Yes, 'Bi' or 'bi_' are possible alternatives. The reason I prefer _bi is
that when you type "boost::" and your smart editor pops up a list of
identifiers, _bi stands out as obviously 'implementation-detail-ish.'
Another point against bi_ is that a trailing underscore is my convention for
private members.

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