Hello Friends,
I try today to give a thread a reference from a std::map. The thread have to fill the map but the run finction say that the reference variable are not declared in that scope ..
so the constructor looks like this
Qt Code:
using namespace std; .... MyThread::MyThread(map <int> &p_Map, { } MyThread::run() { //using p_Map; }To copy to clipboard, switch view to plain text mode
and I try to use it in run()
is giving a reference to thread not allowed???
Or what is the best method to fill a map or a vector within a thread????
Bookmarks