Support type substitution of template types #103
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Extends Bindgen's type parser to handle C++ templates, and adds methods that replace names in a given type with other types. This PR lays the groundwork for at least 2 scenarios:
const QVector<QRgb> &toconst QVector<unsigned int> &, providedQRgbis an alias forunsigned int. This can be used for the first issue mentioned in Generic pseudo-instantiation macro for container wrapper types #102; before this PR, the most Bindgen could do was resolving one level of aliases in each template argument.QVector<const T *>toQVector<const QVector<int> *>, providedTis instantiated withconst QVector<int> &(notice the combination of const-ness and references and pointers). This allows for example the possibility of defining container interfaces in the config files.The parser and the substitution both fully handle arbitrarily nested templates; the returned
Parser::Types respect the template structure at all levels, and should match what would be produced by the Clang parser.