The semantics of this `if(ec)` is "conditionally well-defined": provided that you make sure that in all error categories you use throughout your program zero indicates success and non-zero values indicate failure, then (and only then) does this construct test if `ec` represents a failure.
Forgive me for the noise in case I've missed something, but if the primary concern is that we want to be able to support non-zero success codes, why not just make the error_category carry the int representation of success instead of assuming that it's always zero? It's not as generic as introducing a new virtual that allows one to do whatever (for example there would still be one blessed value, so you couldn't have different 'success' values), but it's almost certainly faster than a virtual call, and might satisfy most of the use cases. -- chris