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

Consider calling getOwned for object_owned idl type

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Server Programmability

      when generating the constructor.

      Example:
      https://github.com/mongodb/mongo/blob/eac5afb151fc64740763316c128a46c8c664d37e/src/mongo/db/s/config/set_cluster_parameter_coordinator_document.idl#L58

      Generates code looks like this:

      SetClusterParameterCoordinatorDocument::SetClusterParameterCoordinatorDocument(mongo::BSONObj parameter) : _parameter(std::move(parameter)), _hasParameter(true) {
          // Used for initialization only
      }
      

      Instead of

      _parameter(std::move(parameter))
      

      consider doing this instead:

      _parameter(parameter.getOwned())
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: