cxx
cxx copied to clipboard
WIP: Allow for Clone bound on extern Rust type + Box clone
Fixes #105.
First, extends the parsing syntax to allow for Clone
bounds added to an extern Rust type.
Then, introduces a public Box clone() const noexcept;
member on Box<T>
that will only be callable if T
is declared as Cloneable
.
Finally, exposes a clone FFI function callable from C++ to clone the Box. These bindings are only generated if the type derives Clone
or has a trait bound for Clone
.
Tested with cargo test
Still todo:
- [ ] Fix trybuilt test cases
- [ ] Make sure the approach makes sense.
- [ ] Extend documentation to describe the new behavior.
Ominous #666
Don't have time to pick this back up