Closed richelbilderbeek closed 5 years ago
Is your feature request related to a problem? Please describe.
I find here:
void game::remove_tile(...) { //... try { if(m_tiles[i].get_id() == m_selected.at(0)){ m_selected.pop_back(); } } catch (std::out_of_range) { std::cout << "segmentation fault\n"; } }
This is problematic for multiple reasons:
Describe alternatives you've considered
Add asserts and use the operator[] instead:
operator[]
assert(i < static_cast<int>(m_tiles.size()); assert(0 < static_cast<int>(selected.size()) if(m_tiles[i].get_id() == m_selected[0]){ m_selected.pop_back(); }
Additional context
None.
Is your feature request related to a problem? Please describe.
I find here:
This is problematic for multiple reasons:
Describe alternatives you've considered
Add asserts and use the
operator[]
instead:Additional context
None.