BSONObj::getObjectID should be const qualified

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 1.3.0
    • Affects Version/s: 1.2.0
    • Component/s: Internal Client
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • 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 Horowitz (Inactive)
            Reporter:
            Ianiv Schweber
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: