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.
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.