Comment by kibwen
7 years ago
Amusingly, C++ also supports Rust-style function headers, and has since C++11 (which is well before Rust was ever on the radar; really both C++ and Rust were inspired by ML here). The following two are identical in C++:
u32 foo(u16 x, u16 y)
auto foo(u16 x, u16 y) -> u32
IIRC there are contexts where the former does not work and the latter is required, which I believe means that ML-style function headers are strictly more powerful in C++ than the original C-style function headers.
No comments yet
Contribute on Hacker News ↗