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

confused about using template class type as parameter in declaration #163

Closed
KeyID7 opened this issue Nov 13, 2021 · 1 comment
Closed

Comments

@KeyID7
Copy link

KeyID7 commented Nov 13, 2021

Suppose my header file contains such function declaration:

void foo(std::vector<int>);

Since it's only a declaration, the template class std::vector will not be instantiated thus binder will skip the function. However, I expect binder to generate the binding for this function. The .o files containing the definitions will be linked at last.

I have seen issues about templates, like #80 and #101, and know I can use explicit instantiation. But it will be hard to add explicit instantiation for a large project. Is there any simpler way?

@lyskov
Copy link
Member

lyskov commented Nov 17, 2021

@KeyID7 issue here is that during the Binding process Binder is getting type that is not fully instantiated so it can not be bound. It seems plausible that there should be a way to instantiate templates within LLVM framework but so far this has not worked for me. But if someone knows how to do it and can share such info that i will be happy to implement this!

@lyskov lyskov closed this as completed Nov 17, 2021
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