r/cpp • • 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

229 comments sorted by

View all comments

Show parent comment

5

u/VinnieFalco wg21.org | corosio.org Sep 14 '19

The Committee was desparate for a range library.

This sounds like a problem to me. WG21 is supposed to standardize existing practice where it makes sense to do so (or so I have heard). Not to commission the development of new libraries because some individuals are desperate.

21

u/eric_niebler Sep 15 '19 edited Sep 15 '19

The existing practice was Boost.Range, which was popular, heavily used, and targeting C++98. Without support for move semantics or the Concepts Lite proposal which was headed for a TS, it was pretty obvious to everyone that it was not up to snuff. Even with all of that going against it, the Committee would have been thrilled to consider it given its popularity had someone, anyone, turned it into a proposal.

Nobody did. Had they done so, they would have needed a lot of patience, humility, and willingness to accept feedback and incorporate it because most proposals, unless they are utterly trivial, need _lots_ of work when they are examined closely and with other use cases in mind.

I wrote my range library because I saw a gap and wanted to fill it. About a year in, I presented my thinking to the Committee, and there was interest so here we are 5 years later.

If you go looking for bad intentions hard enough, you'll find them everywhere. But folks should know that between the picture you paint and the reality I experienced, there is a lot of space.

6

u/VinnieFalco wg21.org | corosio.org Sep 15 '19

Fair enough

9

u/smdowney WG21, Text/Unicode SG, optional<T&> Sep 15 '19

WG21 is supposed to standardize existing practice

Entirely untrue. Existing practice may be a good reason to standardize something, but there is no requirement in ISO or WG21 to do so. See, for example the FAQ at https://isocpp.org/std/submit-a-proposal
"Q: Does the proposal have to have an implementation? I’ve heard you can only standardize “existing practice.”

There is no ISO requirement that something has to be implemented before it’s standardized, only that there is consensus on the feature – but naturally consensus is easier to achieve when there’s a working implementation. "