4 ms·
C++'s STL linked list for comparison (libcxx). https://github.com/llvm-mirror/libcxx/blob/master/include/list https://github.com/llvm-mirror/libcxx/blob/master
by mastax 4y ago
C++'s STL linked list for comparison (libcxx).
https://github.com/llvm-mirror/libcxx/blob/master/include/list https://github.com/llvm-mirror/libcxx/blob/master/include/li...
- kortex 4y agoOof. Yeah, standard lib code tends to be harder to read on average than application code. But at least I can mentally parse the Rust code. Heck it even looks like a linked list impl. The c++ code looks barely better than line noise. I'm sure I could wrap my head around it, but ho boy, it's far worse than Rust by a long shot. And this is with several years cpp experience, and maybe a few months of Rust on and off.
- einpoklum 4y agoRust's list only supports a default allocation mechanism. For an actual comparison, you'll want to show us a Rust implementation which is parametrized over allocators. Having said that - yes, it's not pretty. About the same length though.
- mastax 4y agoAdding allocator support does add a bit more noise: https://github.com/rust-lang/rust/pull/103093/files#diff-8bd1153cc6d89a3ef4bcd62045ed29b00fc7ddc4a0937d276b9e17a2ffc2772d https://github.com/rust-lang/rust/pull/103093/files#diff-8bd...