3 ms·
Almost none of the above is something you actually need to know when programming in Rust. You just need to know how closures work at a high level, which is pre
by Manishearth 10y ago
Almost none of the above is something you actually need to know when programming in Rust.
You just need to know how closures work at a high level, which is pretty straightforward. Rust closures are basically the same as C++ closures.
If you're really worried about the generated code generally iterator code with closures compiles down to the same thing as the imperative code. This isn't a hidden complexity unique to Rust; C code these days is pretty far removed from the generated asm too.
- Veedrac 10y agoI strongly disagree. Though it is possible to fudge through working Rust code without understanding the principles that govern Rust, which is probably more than you can say for C++, not understanding these things is going to make life a lot harder when you do run up against them. An example: https://www.reddit.com/r/rust/comments/5iwyt9/how_to_accomplish_this_without_the_compiler/ https://www.reddit.com/r/rust/comments/5iwyt9/how_to_accompl... You might not need to know what "vtable" means, but the differences between, for example, `T: Fn()` and `T = Fn()` are pretty important.