You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add Box<T> to the supported types, where T: Sized #474
Box<T>, where T: Sized is now ABI compatible with the C language's pointer (T*)
types. So if you have an extern "C" Rust function, called from C, your Rust function can
now use Box<T>, for some specific T, while using T* in C for the corresponding function.
This makes sense. To be clear, you can already do this in C++ if you do:
template <typename T> using Box = T*;
For C, and maybe for function arguments, we probably want to do this automagically.
The reason why I think we shouldn't do it automatically for C++ members and such is that in C++ having Box<T> is actually useful (if you don't care about Box parameter-passing).
Activity
emilio commentedon Feb 21, 2020
This makes sense. To be clear, you can already do this in C++ if you do:
For C, and maybe for function arguments, we probably want to do this automagically.
The reason why I think we shouldn't do it automatically for C++ members and such is that in C++ having
Box<T>is actually useful (if you don't care aboutBoxparameter-passing).See also the discussion in #451
mgeier commentedon Mar 27, 2020
Are there any news on this?
It would be great to have this!
emilio commentedon Oct 7, 2020
4ce324c fixed this.
mgeier commentedon Oct 7, 2020
Thanks @emilio, this works great!