Re:C++20 Ranges
by dman on Saturday December 22, 2018 @06:36PM
(#18743145)
This looks like something a library author would write while implementing a range and not something that end users would write while using ranges. Could you point to an implementation in a different language that offers a similar abstraction in a more succinct manner (While offering the same type safety and low runtime overhead).
[ Parent
| on HN ]
Does this this suffice https://doc.rust-lang.org/std/ops/struct.Range.html ?
No, ranges in C++ are analogous to the iterator trait in rust
I feel like what you’re touching at is kind of the core of why C++ can be so difficult to parse through sometimes. It really is trying to make a general purpose abstraction while also having a low overhead. This results in a need for detail and complexity that you can simply not need to worry about in languages like Python or Clojure.
When my university peers and I were learning C++, a lot of us strongly preferred using C99 since it didn’t seem as awful in terms of complexity and verbosity.