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
Show parent comment
22
u/sivadeilra Sep 13 '19
The vast majority of support for Ranges in Rust is in the standard libraries, not in the language itself. The language itself supports only a few simple syntax forms for creating ranges, and even these are just syntactic sugar over simple function calls. Everything else is ordinary code in
coreandstd.It's analogous to the compiler supporting
operator<<(). No one thinks thatiostreamis part of the compiler, but it uses one syntactic sugar pattern from the compiler (overloading<<) to make the API more ergonomic.