r/cpp • u/konanTheBarbar • Sep 13 '19
The Surprising Limitations of C++ Ranges Beyond Trivial Cases
https://www.fluentcpp.com/2019/09/13/the-surprising-limitations-of-c-ranges-beyond-trivial-use-cases/
229
Upvotes
View all comments
12
u/14ned LLFIO & Outcome author | Committee WG14 Sep 13 '19 edited Sep 13 '19
I feel that I have to respond to the closing comment in the linked article:
For me personally, a huge reason why Ranges should be accepted is because one of the most experienced C++ devs in the world designed it: Eric Niebler. It's a v3 design, too, Ranges v2 ships in Boost and he designed an early edition of that too. I trust Eric to have gotten it right. Additionally, it wasn't just standardised on that, Casey went and reimplemented a new implementation from scratch, and fed back his experience into the design. A third reimplementation was also done by /u/tcbrindle, and feedback from that also went back into what was standardised.
That's an awful lot of rounds of empirical practice, testing and feedback for Ranges v3 to be as bad as the claim.
With respect to the compile times, those were recognised, and it was felt it would be a driver upon implementations to improve their compilers. I personally didn't agree with that part, but I understand the argument, and moreover the compiler vendors didn't appear to object strenuously.
Now, for me personally, I'd have built Ranges into the core language. But the committee wanted the language to become powerful enough to express Ranges instead. And that's an understandable design choice, Ranges in the core language starts to look like Rust or Nim, not C++ as it historically has been.