
15 Feb
2006
15 Feb
'06
12:31 p.m.
Marc Mutz wrote:
On Wednesday 15 February 2006 01:03, João Abecasis wrote:
C++ question. Use &MyClass::ChildThreadFunction as bind's first argument. You will probably also run into trouble with passing the int by reference (why?).
Because MyClass::ChildThreadFunc is run in a different thread, in a separate timeline, and when it runs the variable ii may no longer exist (?).
I'm sorry. This wasn't mean to be a GotW-style 'why?', but just short for "why did you do it that way?" :)
But thanks nonetheless, yes, that's what I had in mind :)
Note that this is not a problem in this particular case; the reference is bound to the internal copy of ii that is stored by boost::bind into the created function object.