Boost logo

Boost Users :

From: Peter (yg-boost-users_at_[hidden])
Date: 2002-06-18 17:23:32

Thanks guys. I asked the same question on the other newsgroup (for
developers i think) and someone suggested thread::bind as well. That worked
very well.

"bill_kempf" <williamkempf_at_[hidden]> wrote in message
> --- In Boost-Users_at_y..., Mark Storer <mstorer_at_c...> wrote:
> > This has little to do with boost (which, again, is why I can
> answer; at
> > least in part)
> >
> > A member function cannot be addressed like a regular function. Ask
> yourself
> > this question: With just a function pointer to go by, what will the
> > compiler use for 'this'?
> >
> > The Good News: STL contains a template functor to take care of this
> for you:
> > "std::mem_fun". I haven't messed with it personally, but the docs
> sure make
> > it sound like it would do the trick.
> >
> > The Bad News: I'm not so sure the thread class will let you use
> it.
> >
> > I'm not familiar with the function0<> template, so I don't know
> whether or
> > not std::mem_fun will work with boost::thread.
> Any function object that takes no parameters and returns void will
> work here. This includes std::mem_fun. I might suggest boost::bind
> instead, though. It's a little more flexible then the adapters
> provided by the standard.
> Bill Kempf

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at