News for hackers. Stuff that matters.
Re:C++ Filesystem Technical Specification approved by ISO by ridiculous_fish on Saturday January 03, 2015 @03:11PM (#8831827)
It looks like most functions have two variants that differ in how they handle errors. One throws exceptions, and the other returns an error_code.

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.

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.