Skip to content

SharedPtr<const OpaqueType> #850

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

Open
smessmer opened this issue Apr 24, 2021 · 0 comments
Open

SharedPtr<const OpaqueType> #850

smessmer opened this issue Apr 24, 2021 · 0 comments

Comments

@smessmer
Copy link

smessmer commented Apr 24, 2021

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.

faho added a commit to faho/fish-shell that referenced this issue Apr 11, 2023
This makes function_properties_ref_t not const, in order to work
around cxx - I'm assuming google/autocxx#799
/ dtolnay/cxx#850
faho added a commit to faho/fish-shell that referenced this issue Apr 11, 2023
This makes function_properties_ref_t not const, in order to work
around cxx - I'm assuming google/autocxx#799
/ dtolnay/cxx#850
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