|
Boost : |
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-04-12 09:15:52
"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:001501c42095$eb0425b0$1d00a8c0_at_pdimov2...
> Thorsten Ottosen wrote:
> >
> > 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.
>
> Why should it not compile?
consider instead
void write_to( string& s )
{
s += " foo";
}
string s = "bar";
bind( write_to, s )();
cout << s; // won't print "bar foo"
br
Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk