You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Documentation (https://google.github.io/autocxx/workflow.html) does not explain how to implement the #[cxx::bridge] for passing vector of pointers to objects std::vector<Type*> from C++ to Rust. This is relatively common use-case.
To Reproduce autocxx can not generate bindings for std::vector of pointers to objects, like std::vector<Type*>
# [doc = "autocxx bindings couldn't be generated: Type std::vector was parameterized over something complex which we don't yet support"]
pub struct instrument_list ;
Expected behavior
It would be great to provide some example of #[cxx::bridge] when C++ code pass std::vector<Type*> to Rust code and methods of Type can be called from Rust side.
Additional context
There is the unit testtest_vector_of_pointers() for similar use-case, but there is no example how to write correct #[cxx::bridge] for passing vector of pointers to objects.
The text was updated successfully, but these errors were encountered:
Fundamentally, autocxx is limited to the types supported by cxx, and I don't believe that a CxxVector<*const T> is supported by cxx.
About three years ago I tried to implement this but ran out of time - feel free to take over that work! Once it's supported in cxx, it should be easy enough to support in autocxx too.
Describe the bug
Documentation (https://google.github.io/autocxx/workflow.html) does not explain how to implement the
#[cxx::bridge]
for passing vector of pointers to objectsstd::vector<Type*>
from C++ to Rust. This is relatively common use-case.To Reproduce
autocxx
can not generate bindings for std::vector of pointers to objects, likestd::vector<Type*>
instrument.hpp
lib.rs
Generated
.rs
contains:Expected behavior
It would be great to provide some example of
#[cxx::bridge]
when C++ code passstd::vector<Type*>
to Rust code and methods of Type can be called from Rust side.Additional context
There is the unit test
test_vector_of_pointers()
for similar use-case, but there is no example how to write correct#[cxx::bridge]
for passing vector of pointers to objects.The text was updated successfully, but these errors were encountered: