bytedeco/javacpp

Handle braced initializers with const member values

Open

#808 aberto em 3 de jun. de 2025

Ver no GitHub
 (3 comments) (0 reactions) (0 assignees)Java (620 forks)batch import
enhancementhelp wantedquestion

Métricas do repositório

Stars
 (4.279 stars)
Métricas de merge de PR
 (Mesclagem média 2d) (1 fundiu PR em 30d)

Description

I am trying to wrap a library that contains a class like this:

    class A
    {
    public:
        const uint32_t       b;
    };

The class can be initialized using:

    A a{ 2 };

When compiling the javacpp wrapper however I get the following errors:

error: use of deleted function ‘A::A()’
note: ‘A::A()’ is implicitly deleted because the default definition would be ill-formed
error: uninitialized const member in ‘class A’
note: ‘const uint32_t A::b should be initialized

Sadly I cannot find a way to handle braced initializers without constructors in the documentation. Is there a way to generate a valid wrapper using javacpp at the moment?

Thank you for your help in advance!

Guia do colaborador