cxx icon indicating copy to clipboard operation
cxx copied to clipboard

How to pass an opaque pointer to Option<T> between languages?

Open djmarcin opened this issue 3 years ago • 0 comments

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?

djmarcin avatar May 30 '21 07:05 djmarcin