Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Example code in response to #251 (comment).
Note this line is using
cxx::kind::Opaque
:cxx/scoped_ptr_demo/src/main.rs
Line 16 in bb4fda0
because passing a boost::scoped_ptr by value across the FFI is not possible due to both of the following being true:
It uses the "small class" ABI in C++ which Rust has no representation for. Any Rust data structure will always either look like "small POD" or "big classes" as far as the ABI in C++.
It exposes no way to exit out of "small class" state (analogous to
unique_ptr<T>::release
which is what we use for making UniquePtr work by value on the language boundary).For a different smart pointer for which one or both of these doesn't apply you'd probably use
cxx::kind::Trivial
because Rust's move semantics are non-problematic for anything pointer-like.