myList()
Since myList is neither a function nor has an operator () this does not make any sense.
I need a book (or somebody's project source code) which properly explains OOP
I took a few days break from programming and I'm back to the error hunting again.
std::list<Thing> myList; myList.push_back(Thing(10, 12)); myList.push_back(Thing(11, 13));
for (Thing& thing : myList) myList()->drawMe(wallGFX, screen);
error: no match for call to '(std::list<Thing>) ()'
So I think the second part there is supposed to get the pointer to the object then access its method. By the error it seems it cannot find the objects, or perhaps it cannot find the list. Both the list and its objects are declared in the main function :blink:
Take a step back and think for a bit.
What does this do?
for (Thing& thing : myList)
With that in mind, which one variable do you always expect to see used in the loop body, regardless of what the loop does?
Now you should be able to see the problem.
I definitely need to take a step back... I was implementing BitMaster's code into my program and somehow that part was not updated. It was meant to be:
thing.drawMe(/* function arguments here */);
That makes a million times more sense. Instead of trying to call a list as if it were a function, I'm meant to access the object's member function duh. After too many hours in front of the screen (no matter how dimmed) my eyes go blurry and I cease to make sense to myself.