bytedeco/javacpp

Creating instances of C++ templates with parameter packs

Open

#773 aperta il 21 lug 2024

Vedi su GitHub
 (3 commenti) (0 reazioni) (0 assegnatari)Java (620 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (4279 star)
Metriche merge PR
 (Merge medio 2g) (1 PR mergiata in 30 g)

Descrizione

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?

Guida contributor