Add equality operators for options and result classes

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Done
    • Priority: Major - P3
    • 3.2.0-rc0
    • Affects Version/s: None
    • Component/s: API
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Isabella Siu (Inactive)
            Reporter:
            J Rassi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: