AMDG On 04/11/2013 01:57 PM, Yannick POTIN wrote:
<snip>
// A template variadic function... template<class ...classes> boost::function0<void> call_something(classes... c) { // ... here we are: return boost::bind(call_a,boost::ref(c...)); }
<snip> ---------------------------------------------- After compilation, I get this output (watch the memory addresses): 0xbfc8f994::operator()(): 1 0xbfc8f990::operator()(): 2 0xbfc8f984::operator()(): 1 0xbfc8f984::operator()(): 2 I really don't know what happened (even if I can imagine). But references are just lost and this is not good.
So, here is my question: How can I make this working ?
The arguments of call_something are passed by value. Try: template<class ...classes> boost::function0<void> call_something(classes&... c) In Christ, Steven Watanabe