google/autocxx

New method of POD-Types not creating a POD rust type

jasper310899 opened this issue · 0 comments

Description
Eventough the docs imply that calling the assoicated new function of a generate_pod! type would create a POD rust type that is not the case and the only way to aquire one is to use the rust style initializer {a: x, b: y, ...}.
This is quite problematic because if a C++ field is private that makes Rust-POD construction impossible.

Also I noticed that overloading the constructor is still considered POD to autocxx and I am now unsure if that is actually intended or an oversight.

It should also be noted that the C++ pod monomorphizations get recognized as non-pod:

template <typename T> struct Array {
    T value;
};

typedef Array<int> podtype;

static_assert(std::is_pod<podtype>());

Expected behavior
New calls the constructor of C++ and returns a Rust-POD object.

Additional context
I am writing a thesis on Rust C++ binding generation.