Skip to content
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

Support dependent fields in internals #197

Closed
ddobrev opened this issue Feb 28, 2014 · 2 comments
Closed

Support dependent fields in internals #197

ddobrev opened this issue Feb 28, 2014 · 2 comments

Comments

@ddobrev
Copy link
Contributor

ddobrev commented Feb 28, 2014

We need to handle cases such as:

template
class Whatever
{
T Foo;
}

class Bar
{
Whatever W;
}

In here, Foo is a dependent field. We need to represent it in Internals as an int. One of the approaches is generating a separate internal struct per template specialisation.

@tritao
Copy link
Collaborator

tritao commented Feb 28, 2014

Another possible approach is to generate the dependent fields recursively in the internal definitions, without having to generate an explicit Internal struct for each template specialization, though long-term, that approach would be better, since we could also generate a proper class for it, to be able to access template specializations directly in C#. That's a bit tricky too, and it might be better to spend the effort on getting the cross-platform C++/CLI working.

@ddobrev
Copy link
Contributor Author

ddobrev commented Jun 21, 2016

Dependent fields in internals are actually impossible to support. Structures with native layouts cannot be generic so we can only use separate structures per specialisation which we already do.

@ddobrev ddobrev closed this as completed Jun 21, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants