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

BSONObj::getObjectID should be const qualified

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.3.0
    • Affects Version/s: 1.2.0
    • Component/s: Internal Client
    • None

      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

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

              Created:
              Updated:
              Resolved: