Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1050

Add equality operators for options and result classes

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.2.0-rc0
    • None
    • API

    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.

      Attachments

        Activity

          People

            isabella.siu@mongodb.com Isabella Siu (Inactive)
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: