-
Hello, It seems that in certain cases an ASSERT is executed instead of throwing an exception, this causes unit tests to fail on the debug and the program crashes. I could reproduce it with a small example but now it works :(, I can reproduce it anytime with my project.
Now same code but using a lambda
Nothing happens, the program just crashes, because it goes to this line: (but my json is a reference, not a pointer) Sometimes it goes to: My question is: why is the In my original code I have smth like
Any advices? Maybe should I use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The first snippet calls Documentation: |
Beta Was this translation helpful? Give feedback.
The first snippet calls
operator[]
on a non-constjson
value, whereas the latter does so for a constjson
value. The behavior is different, just as you observed. Please useat
if you want checked access which always throws in case of a missing key.Documentation: