3 ms·
C++ reference types are first-class. But instances of reference types are not first-class values. References are not objects, in standard speak, they do not hav
by Sharlin 9y ago
C++ reference types are first-class. But instances of reference types are not first-class values. References are not objects, in standard speak, they do not have a memory location, you can't take their address, you can't pass them to functions (a reference parameter means passing a value by reference, not a reference by value). And so on. Rust references are more like C/C++ pointers or Java references in that they are actual values, and AFAIK Rust functions, like Java and C functions, are strictly pass-by-value.
- wyldfire 9y agoThis is a really helpful distinction, thanks for clarifying.