-
Notifications
You must be signed in to change notification settings - Fork 66
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
Using Binder for templated methods #101
Comments
Unfortunately Binder can not instantiate template methods so If above does not help then try this: in one of the header of your project add dummy inline function with body like: |
Explicitly instantiating the necessary methods in a header that's just for Binder is what I ended up doing. But that required some build system tomfoolery to get Binder to use the header even though no real source files include it, and the header still ends up getting installed alongside the actual headers for the project, when it's only there to control Binder at build time. It would be nice if Binder were to gain the ability to instantiate template methods. |
Have you consider wrapping these instantiation in ifdef's (say
-- absolutely! Unfortunately so far i have not found a way to do it. |
FWIW I've briefly (but unconstructively) complained some about |
In #80 there's an example for how to confince Binder to bind an instantiation of a template class:
I have a non-template class with some template methods (which can be instantiated for
std::function
or for various unique lambda function types). I want Binder to bind one or more instantiations of this method (in particular, one I can pass a Python callable to). Do I need to use a custom+binder
that wraps the class and hides the template method behind a non-template method? Or is there a way to tell Binder to instantiate the method more directly?I already tried:
This doesn't seem to instantiate the template method.
The text was updated successfully, but these errors were encountered: