The IDL compiler generates initializer statements for the _dbName member using variables that have already been moved into local members. Here are a few examples:
build/debug/mongo/db/modules/enterprise/src/search/search_index_commands_gen.cpp
|
519:CreateSearchIndexesCommand::CreateSearchIndexesCommand(const NamespaceString nss, boost::optional<SerializationContext> serializationContext) : _serializationContext(serializationContext.value_or(SerializationContext::stateCommandRequest())), _nss(std::move(nss)), _dbName(nss.dbName()), _hasIndexes(false), _hasDbName(true) {
|
build/debug/mongo/idl/unittest_gen.cpp:BasicConcatenateWithDbOrUUIDCommand::BasicConcatenateWithDbOrUUIDCommand(const NamespaceStringOrUUID nssOrUUID, std::int32_t field1, std::string field2, boost::optional<SerializationContext> serializationContext) : _serializationContext(serializationContext.value_or(SerializationContext::stateCommandRequest())), _nssOrUUID(nssOrUUID), _field1(std::move(field1)), _field2(std::move(field2)), _dbName(nssOrUUID.uuid() ? nssOrUUID.dbName().value() : nssOrUUID.nss()->dbName()), _hasField1(true), _hasField2(true), _hasDbName(true) {
|