The main advantage is that it error_codeis a type for copying that can be transferred from library to library without the need for dynamic allocation of memory or templates, which makes it very light and easy to use.
If you are writing a fully autonomous project, then yes, error codes and categories seem too complicated when you can just have your own type.
, , (, ASIO, think-async.com). error_code, - , , .
, , .
: , , . , , , , .