Re:C++ Filesystem Technical Specification approved by ISO
by beached_whale on Monday January 05, 2015 @12:25PM
(#8839875)
new/delete have done this for a while.
I wonder if this is because it is the boost filesystem v3 library mostly.
It's nice to have non-throwing variant, although the rationale is suspect: it asserts that the non-throwing variants are for "when file system errors are routine," but many large C++ codebases deliberately disable exceptions altogether: Google, Mozilla, LLVM, etc.
Is there precedent for this two-variant approach in other APIs that are part of the C++ standard?
Oh, and this just seems wrong:
> Otherwise, clear() is called on the error_code& argument
Why clear it on success, instead of leaving it alone (like errno)? This makes it harder to sequence calls and then check the error code at the end.