c++ - Compiler errors when using a Boost::Thread with parameters -


i appreciate here. trying call function asynchronously boost::thread, getting errors. real code.

in main:

vector<std::string> = ...; vector<std::string> b = ...; vector<boost::thread> threads;  threads.push_back(boost::thread(do_work, an_integer, a[i], b.begin(), b.end()));  // later join()... 

elsewhere:

void do_work(int i, std::string a_string, vector<string>::iterator begin, vector<string>::iterator end) {     // stuff } 

i quite new stuff, being more used c#. anyway, these errors getting:

error c2664: 'void (int,std::string,std::_vector_iterator<_myvec>,std::_vector_iterator<_myvec>)' : cannot convert parameter 1 'std::_vector_iterator<_myvec>' 'int'  error c2664: 'void (int,std::string,std::_vector_iterator<_myvec>,std::_vector_iterator<_myvec>)' : cannot convert parameter 3 'std::basic_string<_elem,_traits,_ax>' 'std::_vector_iterator<_myvec>'  error c2664: 'void (int,std::string,std::_vector_iterator<_myvec>,std::_vector_iterator<_myvec>)' : cannot convert parameter 4 'std::_vector_iterator<_myvec>' 'std::_vector_iterator<_myvec>' 

i appreciate offer. doing extremely inane! lot.

that compiler error says b.begin() , b.end() different types, can't in code you've listed. recheck code make sure haven't defined b else. (also check an_integer since compiler believes it's iterator.)


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -