
12 Apr
2004
12 Apr
'04
12:13 p.m.
"David Abrahams" <dave@boost-consulting.com> wrote in message news:ufzb9ifv8.fsf@boost-consulting.com...
"Thorsten Ottosen" <nesotto@cs.auc.dk> writes:
I don't have any opinion yet.
I guess I didn't know that I was "misusing" bind(). Anyway, I find it wrong that bind(foo,_1)(i) and bind(foo,i)() differs.
Naturally it has to differ. bind(foo,i) needs to take a copy of i, or we wouldn't be able to do things like:
int square(int);
function<void(void)> f(int x) { return bind(square, x * 5); }
My point is that if the prototype was void square( int& ); then function< void(void) > f( int x ) { return bind( square, x*5 ); } should not compile. It should only compile with a call to ref(). br Thorsten