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

Problem with C++ function overloading mapping to the same java type #492

Closed
egolearner opened this issue Jun 3, 2021 · 4 comments
Closed
Labels

Comments

@egolearner
Copy link
Contributor

class TestTemplate {
public:
       int test(int *a) {}
       int test(unsigned*a) {}
};

JavaCpp will only generate one function

       public native int test(IntPointer a);
       public native int test(IntBuffer a);
       public native int test(int[] a);

It does not work by specifying the following

        infoMap.put(new Info("TestTemplate::test(unsigned *)").javaNames("testUnsigned"));

or

        infoMap.put(new Info("TestTemplate::test(unsigned*)").javaNames("testUnsigned"));

How to help JavaCpp generate both functions?
Any guide is appreciated.

@saudet
Copy link
Member

saudet commented Jun 3, 2021

Again that should work. Do you have a complete example that I can try here?

@egolearner
Copy link
Contributor Author

@saudet you can use the code snippet directly which is compilable.
Let me known if there is anything missing.

saudet added a commit that referenced this issue Jun 4, 2021
…ng parameters as well (issue #492)

 * Fix `Parser` producing incorrect calls to function templates with non-type parameters (issue #491)
@saudet
Copy link
Member

saudet commented Jun 4, 2021

Fixed in commit b4cf59a. Thanks for reporting!

@saudet saudet added the bug label Jun 4, 2021
@egolearner
Copy link
Contributor Author

Problem solved.
Thanks for your help @saudet !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants