Boost logo

Boost Users :

Subject: [Boost-users] Passing arguments to threads
From: r ottmanj (rottmanj_at_[hidden])
Date: 2009-03-16 05:06:07

I am working on an application that takes use of boost::thread. During the
initial method of my application I need to pass one argument to the method.
As per the api documentation for boost::thread I am using the following:

boost::thread dataThread(dparse.dataMain,instUUID);

However, when I attempt to use this, I get the following exception from my
compiler. Is there something that I am missing? I do not see how my thread
constructor is any different from the constructor in the api documentation.

Any help with this is greatly appreciated.

error: no matching function for call to ‘boost::thread::thread(<unresolved
overloaded function type>, std::string&)’
/usr/include/boost/thread/thread.hpp:38: note: candidates are:
boost::thread::thread(const boost::function0<void,
std::allocator<boost::function_base> >&)
/usr/include/boost/thread/thread.hpp:37: note:
/usr/include/boost/thread/thread.hpp:35: note:
boost::thread::thread(const boost::thread&)

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