3 ms·
I was disappointed they didn't do a test case with std::error_code. EDIT: Is there something wrong with std::error_code? I don't care about my points, but I'm
by CodeMage 7y ago
I was disappointed they didn't do a test case with std::error_code.
EDIT: Is there something wrong with std::error_code? I don't care about my points, but I'm worried I might have missed something I should know.
- ncmncm 7y agoIt would reveal nothing meaningful. We know how slow handling status codes is, and we know it is equally slow, pass or fail.
- Thorrez 7y agoI personally have a hard time understanding std::error_code. Specifically I can't figure out when std::generic_category vs std::system_category should be used, and I worry that confusion between the 2 of them will lead to confusing and inconsistent APIs where it's hard to predict what error_code will be returned in what situation.
- vlovich123 7y agostd::system_category and std::generic_category are generally the same on non-Windows platforms. std::system_category on Windows is any Windows error (HRESULT, GetLastError, etc) and std::generic_category always represents errno. So for cross-platform APIs that exist on both you'll generally use std::generic_category as the API is usually defined to modify errno in the case of an error. For Windows-only APIs use std::system_category.