Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-04-12 05:28:43


"Vladimir Prus" <ghost_at_[hidden]> wrote in message
news:c5dpev$rrt$1_at_sea.gmane.org...
[snip]
> What I was saying is that bind uses non-const reference for operator(), so
> if you use:
>
> bind(foo, _1)(i);
> bind( foo, _1 )(ci);
>
> then it will work ok. In fact, first one compiles and the second one does
> not.

yep.

> And, BTW, "foo(i)" compiles just fine too, so your 'proper_forward(i)'
> should compile too, but it does not.

yes, but there is a huge difference between compiling wrong code silentltly
and rejecting
ok code. The use of ref() nicely documents that an address is taken.

>As for
>
> bind(foo, i)();
> bind(foo, ci)();
>
> 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.

br

Thorsten


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