-
Notifications
You must be signed in to change notification settings - Fork 339
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
CxxVector<*mut Thing> #795
Comments
I have not looked at your branch but naively I would expect to see: // cxx crate
unsafe impl<T: MutPtrVectorElement> VectorElement for *mut T {}
// downstream crate
unsafe impl MutPtrVectorElement for Thing {} Alternatively it's probably fine to assume std::vector<T*> has a consistent layout independent of T, and have just one impl instead of a generic one. |
Thanks, that points me in the right direction. |
I am considering writing structs like MutPtr |
I had a crack at implementing
CxxVector<*mut T>
andCxxVector<*const T>
here:master...adetaylor:ptr-vecs-wip
It didn't work out too well, (I think) because we try to
impl ::cxx::private::VectorElement for *const BlobstoreClient
and the orphan rule doesn't appear to allow us to do this.I may have the wrong idea for what went wrong here, but it looks like RFC1023 does indeed mention references but not pointers.
I'm unlikely to come back to this any time soon but thought I'd report my findings.
The text was updated successfully, but these errors were encountered: