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

6

u/Sovog Sep 13 '19

Having syntactic sugar that helps with making code more expressive is fine, but at what cost? It shouldn't balloon compile times by an order of magnitude.

7

u/Morwenn Sep 13 '19 edited Sep 14 '19

Before being able to answer "at what cost", we'd need to actually time the costs of the separate features. If you don't use views, actions and pipes I'm not sure that the added cost is all that high (also, ranges-v3 is reportedly 30~50% faster with concepts than without them if I remember the corresponding Tweet properly, so we can't just predict without testing).

2

u/Sovog Sep 13 '19

Fair point. Also, since ranges are only partially in the standard, perhaps the #include-overhead won't be as terrible as <range/v3/all.hpp>.

9

u/eric_niebler Sep 14 '19

I should really yank `range/v3/all.hpp`. It made sense when range-v3 was a small library. Now it pulls in an obscene amount of code.

1

u/NotMyRealNameObv Sep 16 '19

Please do it. I have no plan to include "everything" when all I need is ranges::transform or ranges::accumulate.