[CXX-1050] Add equality operators for options and result classes Created: 27/Sep/16  Updated: 27/Feb/18  Resolved: 20/Jun/17

Status: Closed
Project: C++ Driver
Component/s: API
Affects Version/s: None
Fix Version/s: 3.2.0-rc0

Type: New Feature Priority: Major - P3
Reporter: J Rassi Assignee: Isabella Siu (Inactive)
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CXX-1145 Remove CHECK_OPTIONAL_ARGUMENT_WITHOU... Closed

 Description   

Previous description:

We should add equality/inequality operators to all options classes and result classes. Additionally, we should audit any classes with existing `==` to make sure they also having corresponding `!=` implementations.

Adding equality operators to a number of struct-like classes in the codebase would facilitate testing and possibly be useful to users. We should make a decision on which classes to add equality operators to (options classes? model classes? hint? uri? pipeline? validation_criteria?), and update these classes accordingly.

As part of this ticket, we should audit existing classes to see if any are providing operator==() but are failing to provide operator!=(), as we've noticed at least one class in this state (mongocxx::read_preference).

Original description:

hint.hpp defines equality operations against std::string and bsoncxx::document::view, but does not define equality operations against other hints. An operator== overload should be provided to compare two hint objects, and we should consider deprecating the existing operator== overloads.



 Comments   
Comment by Githook User [ 26/Jun/17 ]

Author:

{u'username': u'iwysiu', u'name': u'Isabella Siu', u'email': u'sakurablossom@blueblueworld.com'}

Message: CXX-1050 add equality operators for options and result classes
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/cd5b0cc37abf21e581203e23925b7a42249e2508

Generated at Wed Feb 07 22:01:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.