JOAQUIN LOPEZ MU?Z wrote:
----- Mensaje original -----
[...]
1. The expression
boost::bind(bloodyBindable,idxResponse,::_1,fnAddStats)
does a copy of the idxResponse index, which is not what you want (indices are actually not copyable, more info on why you can still get spurious index copies in certain compilers at http://lists.boost.org/boost-users/2007/10/31777.php ). So, to prevent this copying use boost::ref:
boost::bind(bloodyBindable,boost::ref(idxResponse),::_1,fnAddStats)
More info on the usage of Boost.Ref with Boost.Bind at http://boost.org/libs/bind/bind.html .
thanks for the tip, I already added the boost::ref ...
2. The reason why you can't do the binding directly and have to resort to the bloodyBindable proxy is that modify is *not* a member function, but a member function *template*. To do the binding you have to provide an instantiation of modify, like this:
for_each_it( it,idxResponse.end(), boost::bind( &StatisticsByResponse::modify
, boost::ref(idxResponse),::_1,fnAddStats));
I'm working with VS 2003 (Compiler Version 13.10.3077) and it does not
like nested templates, so I tried doing the following :
typedef boost::function