Closed vector-of-bool closed 3 years ago
Thanks! I also added a unit test that confirms that you are correct about the problem. I have to think a bit more and probably expand the unit test before I merge this into other branches (note I made a branch with name identical to the one you made).
Previously, if a
std::system_error
was caught and passed tounpack_error_id
, then theex.code()
would be unconditionally converted to anerror_id
, even if the code did not correspond to an actualerror_id
value. This effectively prevents reliable use ofstd::system_error
as an exception type.This tweaks to only consider the
system_error
to be anerror_id
if thecode()
of that error matchesis_error_id()
.