Add support for friend templates, including operator overloading.

Closes #196.
This commit is contained in:
William S Fulton 2015-05-04 10:01:34 +01:00
commit 428b6176df
10 changed files with 146 additions and 3 deletions

View file

@ -97,6 +97,15 @@ static int cparse_template_expand(Node *n, String *tname, String *rname, String
Append(cpatchlist, Getattr(n, "sym:name"));
}
}
if (checkAttribute(n, "storage", "friend")) {
String *symname = Getattr(n, "sym:name");
if (symname) {
String *stripped_name = SwigType_templateprefix(symname);
Setattr(n, "sym:name", stripped_name);
Delete(stripped_name);
}
Append(typelist, Getattr(n, "name"));
}
add_parms(Getattr(n, "parms"), cpatchlist, typelist);
add_parms(Getattr(n, "throws"), cpatchlist, typelist);