
11 Mar
2004
11 Mar
'04
4:54 p.m.
On Mar 11, 2004, at 9:42 AM, David Abrahams wrote:
This surprised me; should it have?
#include <boost/bind.hpp> #include <boost/mem_fn.hpp>
struct X { int y; };
int main() { boost::mem_fn(&X::y); // OK boost::bind(&X::y); // Error! }
I'm not seeing any surprises. mem_fn(&X::y) produces a function object that takes one parameter. Therefore the bind equivalent needs an argument or a placeholder: bind(&X::y, _1); -Howard