by arunc · 7y ago · 0 comments
Honest question: why should I use ranges after all?
As I understand, ranges are the core of idiomatic D and they are not worth it (as per OP)?
AFAIK, ranges (at least in D) are not thread-safe [3]. So what real benefits does it bring?
[1] https://accu.org/content/conf2009/AndreiAlexandrescu_iterato...
[2] http://www.informit.com/articles/printerfriendly/1407357
[3] https://github.com/carun/parallel-read-tester/commit/3e69da4...
No it wasn't. Boost.Range library predates Andrei's Range talk in 2009. Boost.Range was introduced in boost 1.32, which was released in 2004:
https://www.boost.org/users/history/version_1_32_0.html
And from Boost.Range's "History and Acknowledgement" it explains where the term came from:
> The term Range was adopted because of paragraph 24.1/7 from the C++ standard
https://www.boost.org/doc/libs/1_32_0/libs/range/doc/history...
Furthermore, what is being standardized in C++ is an expansion of what is in Boost.Range, which uses iterators underneath.
Andrei's term for ranges(and what is in D) are actually quite different as it removes the basis for iterators completely.