You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know I can disable assertion by NDEBUG flag, but then it prints out null in my example (and I'm almost sure this is an UB) instead of expected exception.
I've checked out json.hpp code and found 98 calls to assert, so I don't think above is the only example leading to application shutdown which can't be handled. In my real app I deal with user provided data, so it's quite bad for me. Is it possible to just replace those assertions with exception throws? Or, if assertions are necessary for some cases, is it possible to have something like template parameter specifying assertion handler, which would be defaulted to assert?
I can create a PR by myself, but first I want to know which option is preferred.
The text was updated successfully, but these errors were encountered:
I know I can, but unlike std::map this library allows const [] operator compilation, so I think it should be either disallowed or properly asserted to avoid possible problems.
Let's consider the following code
I expect this code to output
json error
, but instead it shuts down with the following error:I know I can disable assertion by
NDEBUG
flag, but then it prints outnull
in my example (and I'm almost sure this is an UB) instead of expected exception.I've checked out
json.hpp
code and found 98 calls toassert
, so I don't think above is the only example leading to application shutdown which can't be handled. In my real app I deal with user provided data, so it's quite bad for me. Is it possible to just replace those assertions with exception throws? Or, if assertions are necessary for some cases, is it possible to have something like template parameter specifying assertion handler, which would be defaulted toassert
?I can create a PR by myself, but first I want to know which option is preferred.
The text was updated successfully, but these errors were encountered: