Skip to content

Commit

Permalink
Add missing operator!= for BSONObj and BSONElement classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Yakov Markovitch authored and erh committed Oct 22, 2011
1 parent a1e6896 commit 6311f3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bson/bsonelement.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ namespace mongo {
bool operator==(const BSONElement& r) const {
return woCompare( r , true ) == 0;
}
/** Returns true if elements are unequal. */
bool operator!=(const BSONElement& r) const { return !operator==(r); }

/** Well ordered comparison.
@return <0: l<r. 0:l==r. >0:l>r
Expand Down
1 change: 1 addition & 0 deletions bson/bsonobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ namespace mongo {
string md5() const;

bool operator==( const BSONObj& other ) const { return equal( other ); }
bool operator!=(const BSONObj& other) const { return !operator==( other); }

enum MatchType {
Equality = 0,
Expand Down

0 comments on commit 6311f3d

Please sign in to comment.