News for hackers. Stuff that matters.
Re:C++17 and its Technical Specifications by vardump on Thursday March 03, 2016 @03:20PM (#11219702)
> So, you pass file name to your data access library and the file is not there. How are you going to deal with it? Write an error to the log nobody reads and call terminate()? Create a new file and let users guess what happened to the data they expected? Or return an error code?

Perhaps return an error code. Which the caller would check and deal with the error. (Besides, I'd be passing a stream object, not a filename.)

I/O is also network packets, graphics on the screen, motor movements.

> P.S. As to "which functions can throw" - let me suggest a simple rule: every function can, unless you can prove otherwise.

Exactly, that's the problem.

There are no comments on this comment yet.