Here's my desired code:
class Machine {
private:
QSet<State*> states;
State* step(State* st){/*...*/}
public:
void makeStep(){
//...
QTConcurrent::map(states, step);
//...
}
My problem: This doesn't compile, since step()
is neither a global function nor a member of State
. But logically this would be correct, because step()
does not modify a thing - it only accesses a structure of maps, but again, read-only.
What should to get modified, however, is the set states
. I wanted to be smart and modify each State*
concurrently (in a non-blocking fashion).
Should I make step()
global? Would it help?