::errno and ned14's system_code go brrrrrrr
::errno and ned14's system_code go brrrrrrr
I've always found C++'s "trend" of handling normal or non-exceptional system errors with exceptions lackluster (and I'm being charitable). Overall trimming things down to (basically) passing around a couple integers and telling the user to check their manual is much better, much less error prone, and much more efficient and deterministic.
Use an enum class, it's strongly typed but the compiler just treats it as an integer
Yeah they are quite good and they do basically fall under "just wrap an integer".
Same, I also like giving this the [[nodiscard]] attribute if I want to make sure that it's not ignored.
-Wunused-result
is good practice in general