On 01/16/18 17:06, Peter Dimov via Boost wrote:
Richard Hodges wrote:
Rather than change the meaning of the (ambiguous but no doubt ubiquitous) bool conversion, might it not be better to offer a new method?
if (ec.is_error()) ...
Or ec.failed().
I doubt that we'll be able to change the meaning of `if(ec)` in the standard. Although who knows, it's a compatible change in the case nobody overrides error_category::failed. Which they don't because it doesn't exist yet.
I don't much like `if(ec)`, it's a bit counter-intuitive that it means "failed" and not "succeeded". But it's short and idiomatic.
If you spell it "if (err)" or "if (error)", it is very self-explanatory, IMHO. "if (error.failed())" makes it more verbose without adding any clarity.