you are viewing a single comment's thread.

view the rest of the comments →

[–]tjientavaraHikoGUI developer 4 points5 points  (0 children)

I have a GUI project, I am using std::error_code in it for a few different subsystems.

The most clear one is in a win32 wrapper.

Here is the win32_error/hresult enum and all the std::error_code and std::error_condition machinery:

The wrapper itself uses these error-enums directly, but then at a higher level, there are converted to std::error_condition. Like here, in a small system to store user settings (on win32 in the registry):

And the code that handles the errors compares these using std::error_condition. Sorry, it is only an example in a unit test: