2D Vector: Loading values from .txt file
Your code has a bug. When the very last value cannot be read, it won't detect it. Example:

2 2
1 2
3 invalid


Instead of checking for eof, check whether mapFile &gt;&gt; current returns true.