-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not support classes or structs which are contained within template classes #14
Comments
As a note, this also affects the binding in another way as you can see the |
Hello,
You are on the right track. Adding support for inner template classes is a bit complex, since it is buried in the machinery. However, I created a branch for the work on this with an initial commit. IMHO, the correct way to work on this is to add an integration test. See the related commit that creates the branch: And here are some explanations:
I simplified the C++ test code as much as possible: template<typename DataType>
struct Pair
{
struct DataContainer
{
DataType value;
};
DataContainer first, second;
}; If you want to give it a try, this branch is a good starting point, as you can test directly from within the litgen repo. If it is too complex, my advice would be to not use inner template classes, at least for the moment. Cheers |
I have c++ such as:
And when I run litgen on it (specializing
Bezier
using the config), I get output of the form:Where the template class is appropriately specialized, but the contained config structs are not.
Looking through the code for
adapted_types/adapted_class.py
, I see that it only checks that thecpp_element().is_template_partially_specialized()
which does not check whether the classes which may contain the class in question (e.g. up the scope chain) may themselves be template classes and specialized. I've been looking through it some to figure out how I might add such a check, but I'm not very familiar with srcml / srcmlcpp so I figured I'd go ahead and open the issue while I work through it to see if you or anyone else has any ideas.The text was updated successfully, but these errors were encountered: