use input_file.good(), i.e.:
```cpp
while( input_file.good() )
```