10 Apr
2009
10 Apr
'09
10:15 a.m.
Hawkes Steve-FSH016 wrote:
It appears that the create_processor implementation instantiates code that attempts to copy the argument.
It does, and this is why you must pass boost::ref wrapper instead of the reference itself.
processor1 = scheduler.create_processor
(boost::ref(value));
Here you instruct the compiler to convert the parameter into Object &, and therefore boost::ref has no effect, as the conversion takes place "before" the create_processor call. Just omit the "Object &" template parameter and let the compiler deduce it and the code should compile. HTH Juraj Ivančić