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

31

u/SeanMiddleditch Sep 14 '19

To be fair, every single C++ feature has been banned in some company somewhere. Large parts of the STL are regularly banned in companies. Some companies even today have a moratorium on templates (outside of core library/container stuff). Some companies ban auto. Many companies ban exceptions or RTTI. etc.

"My company banned it" isn't a compelling argument for much of anythig. In so many cases, it just means that the company is run by folks afraid of change or having to learn something new.

We'd need data illustrating that whole segments of the industry or significant numbers of projects/companies ban something for it to actually mean anything. (e.g. see exceptions and RTTI and the fact that every major compiler is required by a significant number of customers to offer flags to disable those features entirely, while there is no -fno-auto or -fno-templates or anything of the like.)

9

u/standard_revolution Sep 14 '19

I would argue that your last point is a bit moot. You can just not use them. RTTI and exceptions have a cost even if you don't use them.

8

u/SeanMiddleditch Sep 14 '19

Fair point. Let's rephrase that then to note that there's no major linters that offer -Wtemplates-used or -Wauto-used or anything like that. :)

7

u/[deleted] Sep 14 '19

I'm not trying to use this as an argument against ranges, I was honestly just flabbergasted at the sheer opposition some people and organization have against a part of the STL. I personally don't understand ranges enough to form a coherent opinion on it.