Boost logo

Boost :

From: Mark Rodgers (mark.rodgers_at_[hidden])
Date: 2001-08-17 14:33:52


From: "Peter Dimov" <pdimov_at_[hidden]>
> 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.

I am absolutely opposed to this idea. The order of includes should
not matter. If anything, functional.hpp would include mem_fun.hpp.
However that includes a lot of extra baggage, and also your mem_fun1_t
replacement doesn't use call_traits so I suspect suffers from the
reference-to-reference problem.

Of course that can be fixed, but then we have compiler compatibility
issues, compile time issus and anyway I still have to question the need for
a new mem_fun. It seems that if anything, it should be an implementation
detail. As far as I can make out

     mem_fun( &X::foo )( x, 123 );
and
     bind( &X::foo, _1, _2 )( x, 123 )

are equivalent, so why not only allow the latter form? And I repeat,
given that the latter doesn't actually bind anything, why call it bind?

Mark


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