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

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

Open
jasper310899 opened this issue Dec 30, 2023 · 0 comments
Open

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

jasper310899 opened this issue Dec 30, 2023 · 0 comments

Comments

@jasper310899
Copy link

jasper310899 commented Dec 30, 2023

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.

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

No branches or pull requests

1 participant