What would be a better way to deal with a ifstreams failed state in this code?
I was reading Bjarne Stroustrups principle and practice using C++. Chapter 10.6 is about error handling of iostreams. He highlights that you should always try to recover from a fail()
state if you can while a bad()
state is generally a lost cause.