error code vs error condition

前端 未结 2 836
感动是毒
感动是毒 2021-02-03 20:54

I don\'t quite get why do we need to make a distinction between error code (std::error_code) and an error condition(std::error_condition), aren\'t they

2条回答
  •  无人及你
    2021-02-03 21:43

    The simplest answer to this question I found here: http://blog.think-async.com/2010/04/system-error-support-in-c0x-part-5.html.

    • class std::error_code - represents a specific error value returned by an operation (such as a system call).
    • class std::error_condition - something that you want to test for and, potentially, react to in your code.

    I think it is applicable for C++11 too.

提交回复
热议问题