Console game missues

Pages: 1234
seeplus wrote:
Also note that L17 can be simplified:

 
mTileCoords.emplace_back(row, col);

See https://cplusplus.com/reference/vector/vector/emplace_back/

This is a good advice.

I just want to mention that even without emplace_back the code can still be simplified to:

 
mTileCoords.push_back({row, col});

std::make_pair was something we used a lot before C++11 but I don't think it's very useful anymore because we now have alternatives that are often better.
Last edited on
Topic archived. No new replies allowed.
Pages: 1234