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

BSONObj::getObjectID should be const qualified

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 1.3.0
    • 1.2.0
    • Internal Client
    • None

    Description

      BSONObj::getObjectID is declared as:

      bool getObjectID(BSONElement& e);

      but it does not change the BSONObj, so just like the rest of the field getters, it should be const:

      bool getObjectID(BSONElement& e) const;

      That const_cast in my code is looking ugly

      Attachments

        Activity

          People

            eliot Eliot Horowitz (Inactive)
            ianiv Ianiv Schweber
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: