Skip to content

Commit e570d3e

Browse files
committed
Use kMaxGenerics instead of raw integer literal
1 parent d34b78a commit e570d3e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cpp2rust/converter/mapper.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ matchTemplate(const std::string &template_str,
342342
// result = "Vec<i32>"
343343
std::string instantiateTgt(const std::vector<std::optional<std::string>> &types,
344344
const std::string &tgt_template) {
345-
assert(types.size() <= 9);
345+
assert(types.size() <= TranslationRule::kMaxGenerics &&
346+
"template placeholder exceeds kMaxGenerics");
346347
std::string instantiated_template = tgt_template;
347348
std::string::size_type pos = 0;
348349
while ((pos = instantiated_template.find('T', pos)) != std::string::npos) {

0 commit comments

Comments
 (0)