$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] [Statechart] Passing reference to create_processor()
From: Juraj IvanÄiÄ (juraj.ivancic_at_[hidden])
Date: 2009-04-10 06:15:18
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
> <Test, Object&>
> (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Ä