Papierkorb / bindgen

Binding and wrapper generator for C/C++ libraries
GNU General Public License v3.0
179 stars 18 forks source link

Allow instantiations of nested container types #94

Closed HertzDevil closed 3 years ago

HertzDevil commented 3 years ago

This small patch ensures that template type names generated by Bindgen in some places do not contain >>, to match the Clang parser's output; for example, std::vector<std::vector<int> > would be used instead of std::vector<std::vector<int>>. It seems this is all it takes to support those nested container types; before this the integration test would fail with an invalid lib alias.

The other alternative is to alter the parser itself so that it doesn't add spaces between the >s, which are no longer required in C++11. Clang provides clang::PrintingPolicy::SplitTemplateClosers, but this doesn't seem to be available on Clang 9 (which I use).

Papierkorb commented 3 years ago

If this is all it takes to make nesting work here then 👍 Thanks!