ned14 / llfio

P1031 low level file i/o and filesystem library for the C++ standard
https://ned14.github.io/llfio/
Other
881 stars 45 forks source link

Suggestion - rename value() with perhaps or_throw() #108

Closed eyalz800 closed 1 year ago

eyalz800 commented 1 year ago

It’s a bit surprising to see file.close().value() because why expect a value here? The intent is to throw an exception if we fail and I find it much more expressive to write file.close().or_throw(), which means we either succeed and return result or we throw by which case there is no result. What do you think?

ned14 commented 1 year ago

The .value() stuff comes from the result<T> which LLFIO functions return. Nothing to do with LLFIO.

Unfortunately WG21 have decided that result<T>::value() is an acceptable naming choice, so I'll have to close this. Sorry.