Skipping whitespaces when reading file
The at() method validates that the input is in the correct range. Since you have already done the validation there is no point in using this method you may as well use operator[]

Additionally there is a call to check for empty strings empty() so prfer to use that rather than test the length against zero.

if (line.empty() || (line.length() == 1 &amp;&amp; isspace(line[0])))