Bind/Function: use reference arguments in template variadic functions

Hello,
I'm working on a little project which use the template variadic technology.
I use them with boost::bind and boost::function and found a very annoying bug.
Because I have a lot of files very long and (sorry :-( ) uncommented.
I made a simple but explicit example like this one :
----------------------------------------------
#include

AMDG On 04/11/2013 01:57 PM, Yannick POTIN wrote:
<snip>
// A template variadic function... template
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
participants (2)
-
Steven Watanabe
-
Yannick POTIN