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

How can I return a vector of non-trivial type of C++ to Rust? #1361

Open
lightbulb128 opened this issue Jul 6, 2024 · 0 comments
Open

How can I return a vector of non-trivial type of C++ to Rust? #1361

lightbulb128 opened this issue Jul 6, 2024 · 0 comments

Comments

@lightbulb128
Copy link

I want to return a vector fo non-trivial type from C++ to Rust, but neither CxxVector nor Vec of UniquePtr works here.

    unsafe extern "C++" {
        include!("foo.h");
        type Foo;
        fn create_foo() -> UniquePtr<Foo>;
        fn create_foos(count: usize) -> CxxVector<UniquePtr<Foo>>;
    }
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