Consider calling getOwned for object_owned idl type

XMLWordPrintableJSON

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

      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
              Reporter:
              Randolph Tan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: