I've got a windows dll that throws std::system_error
s with category std::system_category()
.
If they get caught inside the dll, no problem I can compare them with a std::error_condition'
. But, if I catch in my exe that links to the dll, then comparisons always fail because the std::system_category()
in that context does not == the one in the caught exception.
I'm struggling to understand if this should work and there's a bug, or if this shouldn't be supported?
Both the dll and exe link to the same dll version of the CRT.
Also, if the dll and exe linked to static versions of the CRT, I guess this wouldn't be expected to work?
I read this description of std::system_category, (emphasis mine):
Obtains a reference to the static error category object for errors reported by the operating system.