|
Boost Users : |
Subject: Re: [Boost-users] Invoke several functions with the same thread
From: Shaolin (shaolinfinest_at_[hidden])
Date: 2009-08-23 11:53:26
Thanks guys. Ok, I have been playing around and come up with the following
code:
struct my_helper
{
void run(string filenm, string searchtext) {
FileThread object(filenm, searchtext);
object.find();
object.print();
}
};
int main() {
boost::thread_group threads;
my_helper my;
threads.create_thread(boost::bind(&my::run, filearr[i], search));
}
The problem is the create_thread function returns the following error on
compile:
*error: my is not a class or namespace
*
.
2009/8/23 Brad Hubbard <boost_at_[hidden]>
> Shaolin wrote:
>
>> I have a question, what exactly does the following piece of code from the
>> struct do:
>>
>> my_helper(FileThread* object) : object_( object ){}
>>
>> I have seen it used once or twice before but cant find any documentation
>> on it.
>>
> Look up "initialisation lists" (or "initialization lists" LOL).
>
> Cheers,
> Brad
>
>
> _______________________________________________
> 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