cxx
cxx copied to clipboard
How to pass an opaque pointer to Option<T> between languages?
I have cause to pass an Option from Rust -> C++, but it will only be later interpreted after being passed back from C++ -> Rust. I had been doing this manually written extern "C"
functions using a *mut Option<T>
. However, trying to convert this to cxx fails, because cxx complains that the Option is an unsupported type, even though I have tried passing it as either a *mut Option<T>
or Box<Option<T>>
.
How can I tell cxx to treat this as an opaque type?