4 ms·
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 poi
by dman 8y ago
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).
- danbolt 8y agoI 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.
- rudolph9 8y agoDoes this this suffice https://doc.rust-lang.org/std/ops/struct.Range.html https://doc.rust-lang.org/std/ops/struct.Range.html ?
- dfbrown 8y agoNo, ranges in C++ are analogous to the iterator trait in rust
- 12298765 8y agoCheck out Go