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);
dataThread.join();

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:
boost::thread::thread()
/usr/include/boost/thread/thread.hpp:35: note:
boost::thread::thread(const boost::thread&)



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