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

Creating instances of C++ templates with parameter packs #773

Open
iexavl opened this issue Jul 21, 2024 · 3 comments
Open

Creating instances of C++ templates with parameter packs #773

iexavl opened this issue Jul 21, 2024 · 3 comments

Comments

@iexavl
Copy link

iexavl commented Jul 21, 2024

I tried to make a struct with a parameter pack template type as such:

template<typename... Args>
struct Foo
{
    virtual void bar(Args... args) {}
};

and I made a function that takes a specialization of this struct:

void fooFunc(Foo<int, double> b) {...}

I put it in an InfoMapper:

infoMap.put(new Info("Foo<int,double>").pointerTypes("TestType").virtualize());

and it did generate a function that takes the correct type

public native void pPackTest(@ByVal TestType b);

But failed to generate the actual .java file (TestType.java)
Is there something I can do about this, or is this just a limitation of the parser?

@saudet
Copy link
Member

saudet commented Jul 21, 2024 via email

@iexavl
Copy link
Author

iexavl commented Jul 22, 2024

You'll need to set Info.define() for it to do that.

infoMap.put(new Info("Foo<int,double>").pointerTypes("TestType").define().virtualize());
Like this? Because this also didn't work.

@saudet
Copy link
Member

saudet commented Jul 25, 2024

Right, that's probably not going to work with template parameter packs... You can still define wrapper classes manually though.

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

No branches or pull requests

2 participants