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

BSONComparator should delete rvalue ref-qualified makeContainer() functions

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.7.0
    • None
    • Internal Code
    • Fully Compatible
    • Query 2020-05-04

    Description

      It's very tempting to write

      auto set = BSONElementComparator(BSONElementComparator::FieldNamesMode::kIgnore,
                                       stringDataBinaryComparator)
                         .makeBSONEltSet();
      

      but this would be wrong, as the BSONElementComparator must outlive the container. We should delete the rvalue ref-qualified versions of these functions to stop code like this from compiling.

      Attachments

        Activity

          People

            andrew.paroski@mongodb.com Drew Paroski
            kyle.suarez@mongodb.com Kyle Suarez
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: