for (auto& num = file.line_iterator(); num != file.end(); num++) {
if (atoi(num) == 42)
return true;
return false;
Note that 'line_iterator()' isn't something that (as far as I know) is defined in the C++ standard library, but there's nothing preventing it.