Skip to content

Commit a0eef7d

Browse files
committed
edits
1 parent 5625910 commit a0eef7d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cpp2rust/converter/mapper.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ clang::PrintingPolicy getPrintPolicy() {
4242
}
4343

4444
std::string GetMapKey(const std::string &str) {
45-
return str.substr(0, str.find_first_of("<["));
45+
auto n = str.find_first_of("<[");
46+
if (n == std::string::npos || str[n] == '<') {
47+
return str.substr(0, n);
48+
}
49+
// something like int[][] or T1[] -> []
50+
return str.substr(n+1);
4651
}
4752

4853
void AddTypeRule(std::string src, TranslationRule::TypeRule &&rule) {

0 commit comments

Comments
 (0)