For a
given member function of the form void foo::f0(), passing this to boost bind results
in the class instance being copied 7 times.
Storing
the result of bind in boost function incurs another 11 copies
(code
and results are here: http://boost.codepad.org/6jBmoKuj)
Using
tr1::bind and function has slightly better results, but still not ideal: Doing
just tr1::bind results in the class instance being copied 4 times.
Storing
the result of bind in tr1 function incurs another 3 copies
(code
and results are here: http://boost.codepad.org/w1EV6JBY)
Am I
right in saying this is because boost::bind uses normal templates while
tr1::bind uses variadic templates?
Either
way this is not very efficient. Is there a way to improve this?