Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-11-22 10:24:07

From: "Aleksey Gurtovoy" <alexy_at_[hidden]>
> 'boost::mem_fn' documentation states:
> "boost::mem_fn is a generalization of the standard functions std::mem_fun
> and std::mem_fun_ref."
> While in many senses this is true, without deeper explanation of all
> differences/similarities between 'boost::mem_fn' and its std counterparts,
> the sentence can lead one to a conclusion that 'boost::mem_fn' can be used
> as a replacement of 'std::mem_fun' and 'std::mem_fun_ref', i.e. that one
> use the former one everywhere in place of the latters, which (as we know)
> not true.

What particular differences do you have in mind?

> I remember a discussion on the list where the subject was
> thoroughly explored. If it's not too much to ask :), can we have the
> of that discussion in the docs, please? For example, a simple comparison
> table with row titles like "parameters passing", "[first_]argument_type
> const-ness", "argument and result types typedefs", etc. would be more than
> enough (given that the cells are filled too :).

All of these match. The [first_]argument_type constness is a defect in the
standard. The differences in parameter passing are between boost::mem_fn and
boost::mem_fun[_ref], not between boost::mem_fn and std::mem_fun[_ref].

Peter Dimov
Multi Media Ltd.

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