SERVER-120270Open

BSONObjStlIterator uses C++20 range style range

* end() is allowed to return a different type (a sentinel), so operator== knows when it is doing an end check, and can do >= like BSONObj, rather than ==. This ensures that if we somehow end up past the end we exit the loop rather than continuing forever. Alternatively, we could throw in the > case, since something is very wrong if we get there. * operator* doesn't need to return a `T&`, so we can return a BSONElement by value rather than storing one as a member. This gives us more flexibility

Affected Versions
Versions known to exhibit this issue

No affected versions recorded.

Fixed Versions
Versions that include the fix

No fix available yet.

Components
Server components related to this issue

No components specified.

Labels
Tags and classification
sp-bson