4 ms·
Would be curious to see a good C++ translation of that, which a modern compiler can unroll/inline about as well.
by fche 10y ago
Would be curious to see a good C++ translation of that, which a modern compiler can unroll/inline about as well.
- kibwen 10y agoGiven that the Rust compiler uses LLVM as its backend, and given that Rust's closure implementation was inspired by C++'s (though with extra compile-time machinery to make them memory-safe), I'm certain that C++ is just as capable of boiling these abstractions away as Rust is. :) (But admittedly I don't know if iterator adaptors like map and zip are in C++'s stdlib.)
- Karliss 10y agoNot part of stdlib, but it can be done using Boost. https://godbolt.org/g/QBN5zP https://godbolt.org/g/QBN5zP