mystor / rust-cpp

Embed C++ directly inside your rust code!
Apache License 2.0
798 stars 44 forks source link

Use an outparameter to return values from closures #22

Closed mystor closed 6 years ago

mystor commented 6 years ago

This should fix #20 and #18, at a small perf impact for cases where values can be returned in registers. It also has the benefit over https://github.com/mystor/rust-cpp/issues/18#issuecomment-328244881 that the C++ move constructor is used to construct the resulting value into rust code. This makes more values safe to return into rust, although manipulating the values in rust code may still break things.