diff --git a/stub-generator/BaseGenerator.cpp b/stub-generator/BaseGenerator.cpp index fe90ef2..812d235 100644 --- a/stub-generator/BaseGenerator.cpp +++ b/stub-generator/BaseGenerator.cpp @@ -108,12 +108,21 @@ std::tuple BaseGenerator::argsToNamesAndT { std::ostringstream argSS, argTypeSS, typeSS; - bool firstArg{true}; - for (const auto& arg : args) + for (auto i = 0; i < args.size(); ++i) { - if (firstArg) firstArg = false; else { argSS << ", "; argTypeSS << ", "; typeSS << ", "; } + auto arg = args.at(i); + if (i > 0) + { + argSS << ", "; + argTypeSS << ", "; + typeSS << ", "; + } auto argName = arg->get("name"); + if (argName.empty()) + { + argName = "arg" + std::to_string(i); + } auto type = signature_to_type(arg->get("type")); argSS << argName; argTypeSS << "const " << type << "& " << argName;