
16 Jun
2004
16 Jun
'04
12:55 p.m.
On Wed, 16 Jun 2004 07:47:23 -0400, Jeff Flinn wrote:
"Daniel Wallin" <dalwan01@student.umu.se> wrote in message news:capatv$p48$1@sea.gmane.org... Lars Rune Nøstdal wrote:
void f(int x) { cout << "f(int): " << x << endl; }
int x = 0; bind(f, _1)(x); //bind(f, _1)(1); // Does not work. bind(f, _1)(val<int>(1)); // But this does after patching.
This enables the user to pass-by-value if he specifies it explicitly, here is the patch:
Won't this work?
bind(f,_1)( boost::cref(1) );
Jeff Flinn
Uhm, yes it does. :) Maybe the tutorial for bind should mention boost::cref in an example like that? Lars Rune Nøstdal