is this `std::getline()` or your own function? you can write the loop with `while(getline(input, line))`. just suggestion