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
Assume we have an opaque C++ type OpaqueType that is used in Rust and a C++ function that returns std::shared_ptr<OpaqueType> and another C++ function that takes std::shared_ptr<const OpaqueType> as an argument. There is currently no way to directly call it.
Instead, we need to manually bind both OpaqueType and ConstOpaqueType as different independent types to Rust (in c++: using ConstOpaqueType = const OpaqueType), and then also add a binding for a conversion function that converts from SharedPtr<OpaqueType> to SharedPtr<ConstOpaqueType>.
I don't really have a good idea how cxx.rs could improve the flow here, but writing up the issue as a pain point looking for a solution.
The text was updated successfully, but these errors were encountered:
Assume we have an opaque C++ type
OpaqueType
that is used in Rust and a C++ function that returnsstd::shared_ptr<OpaqueType>
and another C++ function that takesstd::shared_ptr<const OpaqueType>
as an argument. There is currently no way to directly call it.Instead, we need to manually bind both
OpaqueType
andConstOpaqueType
as different independent types to Rust (in c++:using ConstOpaqueType = const OpaqueType
), and then also add a binding for a conversion function that converts fromSharedPtr<OpaqueType>
toSharedPtr<ConstOpaqueType>
.I don't really have a good idea how cxx.rs could improve the flow here, but writing up the issue as a pain point looking for a solution.
The text was updated successfully, but these errors were encountered: