Subject: Re: [boost] Interest in a tweener library
From: Julien Jorge (julien.jorge_at_[hidden])
Date: 2012-07-15 08:31:44
Le Sun, 15 Jul 2012 13:37:06 +0200,
Klaim - JoÃ«l Lamotte <mjklaim_at_[hidden]> a Ã©crit :
> I see.
> Did you consider copying the value instead of keeping a reference to
> it? Also, what do you think about allowing the user to use one or the
Sorry I made a mistake in the code that results in a misunderstanding.
The argument of the function g() should not be a reference:
void g( boost::function<double (double)> func )
double t = /* â¦ */;
double d = func( t );
g( &f );
Thus, it is a copy of the function object. There is no reason to keep a
reference to the boost::function here.