Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is nice short-hand that I've wanted for a while. I do wish they would have made them overloads of the existing functions in the same namespace, rather than in a new ranges namespace. Oh well, you can always use that namespace, and even if you don't "::ranges" is still less typing than "begin(), end()".


You can always do something like

namespace rng = std::ranges;


> namespace rng = std::ranges

Aliasing the namespace is great! But pick a good name for the alias. Naming things is, after all, one of the hardest things for programmers to do.

If I see `rng::` without knowing what it is then I'm going to assume it's something to do with a random number generator.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: