4 ms·
c++ is a bit more verbose than rust. think about all the stdlib functions that take begin and end iterators for containers. there's an overload for std::set_dif
by leetcrew 6y ago
c++ is a bit more verbose than rust. think about all the stdlib functions that take begin and end iterators for containers. there's an overload for std::set_difference that takes six arguments, five of them being iterators.
- pjmlp 6y agoRanges and fold expressions take care of that.
- adamnemecek 6y agoThere is a lot more than just those two.
- pjmlp 6y agoI was replying to the provided examples, more examples get more counterexamples.
- leetcrew 6y agothat's true and I am very excited for ranges. sadly I am still waiting for c++17 to be switched on in my build system :/ still there's lots of other stuff that's more verbose in c++ than rust, often because it was bolted on much later. think about getting individual elements out of a tuple. in c++: `std::get<0>(tuple)` for each desired element or `std::tie(elt0, std::ignore, elt2) = tuple;` in rust: `tuple.0`, not sure if there's an equivalent to the std::ignore/std::tie combo
- pjmlp 6y agoC++ has structured destruction now.
- Rusky 6y agoStructured bindings work for simple cases, but Rust's are much simpler and more powerful.
- pjmlp 6y agoUntil ISO C++23 papers for pattern matching get accepted.
- adamnemecek 6y agoWhy wait?
- pjmlp 6y ago40 years of IDE tooling, libraries, GUI toolkits, GPGPU designed for its memory model, shader language dialects with graphical debuggers, tier 1 support on the OS SDKs from Sony, Nintendo, Apple, Google, Microsoft, Arm, Samsung, Huawei, certified compilers for industrial deployments, an international standard independent of US sanctions.
- adamnemecek 6y agoThere is an equivalent to tie let Tuple { elt0, elt2, ..} = value.
- Rusky 6y agoRanges don't really exist yet.
- pjmlp 6y agoThen I wonder how I am using them.
- Qwertious 6y agoMaybe what you're using isn't ranges. But, they seem to work well enough that you think they're ranges, so who cares whether they're ranges or not? They work!
- Rusky 6y agoProbably by using a third-party library, with a pre-concepts-based implementation which is heavy on compile times. Unlike Rust, where they're built in and don't really have that cost. The context here is comparison between Rust and C++, for a side project begun over a year ago. Citing pre-standard C++ features with partial/experimental third party implementations doesn't really make the difference you seem to think, in that context.