Re:How an Engineering Company Chose to Migrate to D
by raphlinus on Wednesday June 20, 2018 @12:02PM
(#17356606)
Yes, it's similar to C++. A Rust `fn()` type is similar to a C++ `(*foo)()` type and at the low level is just a pointer to code. A Rust `Fn` trait object (of which there are several variants) is roughly similar to a C++ std::function and is "fat" in that it can contain data as well as code. Most higher level languages don't make the distinction, buying conceptual simplicity at the cost of potential optimizations when a simple code pointer will do.
[ Parent
| on HN ]
There are no comments on this comment yet.