bsoncxx::document::element::operator[] is documented as non-throwing, however the expression bsoncxx::document::element{}["foo"] throws.
A fix for this issue was attempted in CXX-862, but the fix was incomplete.
Original description:
bsoncxx::document view blubb;
if( blubb["jolo"] )
=> falseif( blubb["jolo"][1] )
terminate called after throwing an instance of 'bsoncxx::v_noabi::exception'
what(): unset document::element
For this, can the exception say, that I'm out of bound of a array, or that no array is existing?
Most awesome would be if the exception would tell the non existing position.This behavior is a bit misleading. I would assume for both the upper behavior in just returning a true or false.
- is duplicated by
-
CXX-1091 document::element::operator[] overloads throw when given an invalid element
- Closed