Boost logo

Boost :

From: John Maddock (John_Maddock_at_[hidden])
Date: 2001-08-18 06:17:04


>To fix the conflict between functional.hpp and mem_fun.hpp, I propose that
>the functional.hpp definition of mem_fun be surrounded by
>
>#ifndef BOOST_MEM_FUN_HPP_INCLUDED
>#endif
>
>The two libraries will then coexist as long as mem_fun.hpp is included
>before functional.hpp.

Doesn't that introduce potential ODR violations?

In any case is your version a true replacement for the version in
<boost/functional.hpp> - for example does it fix the reference to reference
problem?

I'd like to see your version either removed or integrated with
<boost/functional.hpp>, sorry :-(

>is a useful generalization that will become more frequent when shared_ptr
>moves into std.

Making mem_fun work with a shared pointer is nice, but is it really a
killer feature? Users can just as easily pass "my_shared_ptr.get()" rather
than "my_shared_ptr" into this, and since these are generally used as
temporaries there is no lifetime management issue here iether IMO.

>To put it another way, if this were a review for mem_fun.hpp, without any
>mention of bind, how would you vote? Reject it because it's useless?

Personally, I would request that you submit patches for the existing
mem_fun, not submit a new and incompatible one.

- John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/


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