Boost logo

Boost Users :

From: Patrick (patrick_at_[hidden])
Date: 2006-01-27 18:02:57


You are correct the "boost::ref(*this)" is not needed.

Simple(boost::bind(&Simple::run, this))
{}

-----Original Message-----
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Christian Henning
Sent: Friday, January 27, 2006 4:47 PM
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] Spawning a thread on a member function

This is even simpler. Is there is reason for "boost::ref(*this)" ?

class Simple
{
   Simple() : th( boost::bind( run, this ))
   {}

   void run()
   {
         for(;;){
               //Thread's work goes here.
         }
   }

private:

   boost::thread th;
};

_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


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