Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Thread and Boost.Function problems?
From: anony (janezz55_at_[hidden])
Date: 2010-03-04 23:02:16


> By the way, I think the use of boost::function is redundant. Doesn't it
> just work like this:
>
> boost::thread(my_thread, "bla", "lala");

I wanted to give a simple example; in reality my_thread() is a method
and I use something like:

boost::thread(boost::function<void (SomeClass*, std::string const&,
std::string const&)>(&SomeClass::my_thread, this, "bla", "lala");

Is the use of Boost.Function also redundant in this case? I could use
either Boost.Bind or Boost.Lambda, but I think Boost.Function is more
lightweight than either.

Can I instantiate boost::function with an object reference rather than a
an object pointer?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net