
Christopher Kohlhoff wrote:
Peter Dimov <pdimov@mmltd.net> wrote:
An operator== that compares both sysno_vaue() and errno_value() would allow the above to work reliably, though... as long as there is a single sysno in the OS, as you pointed out. :-)
Yes, this does makes me think that it might be better if an error_code only had one true value, and that value is represented by whatever category and error number it is created with. It would only compare as equal to another error_code that was created with exactly the same category and error number. Conversion between errors in different categories should then be explicit (using to_errno or to_sysno, say).
It does have the disadvantage that you would be able to have e1.sysno == e2.sysno && e1.errno == e2.errno && e1 != e2 though. :-)