Skip to content

SharedPtr<const OpaqueType> #850

Open
@smessmer

Description

@smessmer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions