Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-104654

Rename the "deferred comparison" `operator==` on BSONObj.

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Programmability
    • ALL
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None

      This function is incompatible with modern comparators features like =default.
      The standard expectations for something called operator== are broken here.
      It has to return something convertible to bool.

      We can still support the feature that this implements, but we should not continue to call it `operator==`, which is essentially a language-reserved name. We are not free to make it mean something else unless we're operating in a "DSL" paradigm, which I would argue BSONObj is not (as opposed to ostream operator<<, which is).

      From slack #cpp-discuss thread
      https://mongodb.slack.com/archives/C1MT4NHF0/p1746108016432839

            Assignee:
            Unassigned Unassigned
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: