Boost logo

Boost :

From: Aleksey Gurtovoy (alexy_at_[hidden])
Date: 2001-11-23 11:54:24


Peter Dimov wrote:
> > > Out of curiosity, why do you need it?
> >
> > struct something
> > {
> > int id() const;
> > };
> >
> > mtn::vector<something*> some_things;
> > mtn::vector<std::string> result(mtn::transformed_seq(
> > some_things
> > , boost::compose_f_gx(
> > std::ptr_fun(mtn::to_string)
> > , boost::mem_fn(&something::id)
> > )
> > ));
>
> Why not
>
> boost::bind(mtn::to_string, boost::bind(&something::id, _1))
>
> ?

Because you need to introduce people to the library before they can write
that :). 'boost::mem_fn' got there earlier, and then somebody tried to use
it consistently and got herself into troubles :).

> Hm. What might happen is this:
>
> * I make a change to mem_fn.hpp.

Without testing it? hmm.. ;)

> * You make a change to mem_fn.hpp.

I always thought one need to compile/run the tests _both_ before and after
she makes any changes :).

> * mem_fn_test.cpp fails.
> * You get blamed for the failure even though it might be my fault.
>
> So it's best to coordinate updates. ;-)

I have no problems with that. It's just that the policy wasn't clear to me,
and IMO, still, making a trivial fix to a "foreign" library yourself might
make sense (personally, I would only appreciate if someone took care of the
obvious issue in my code for me :). So, what are your comments on the
wording in http://groups.yahoo.com/group/boost/message/20428? Do you think
we should remove p. 2a?

--
Aleksey

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