
28 Oct
2009
28 Oct
'09
2:52 p.m.
2009/10/27 Andrey Semashev <andrey.semashev@gmail.com>:
As I said in my another post, it depends on how postconditions are formed. If "the file does not exist" is the postcondition, I don't see why it should throw in the case you described.
So in some cases, it's useful to allow for wider semantics, with a code indicating the result -- in this case, whether the file was actually removed. It's a rather straight-forward expansion of that idea to functions that never throw and thus return error_codes.