AK: Introduce AK::enumerate similar to C++23's std::views::enumerate
I'm sick of writing C-style loops in JSSC every time I need an index too.
I don't want to fully port JSSC to enumerate just yet since it will conflict with my main JSSC dev branch. I've changed one such loop though in order to not break the "unused code" rule.
The AK::enumerate itself is modeled loosely after C++23's std::views::enumerate but little attention was paid to the value categories and constness. We can always iterate on it in-tree when these things become an issue. First commit also introduces a bunch of stuff ~~inspired~~ copied from Ranges TS but leaves them as an implementation detail.
A couple of notes:
- New features added to AK should always have unit tests
- This implementation feels overly complex and won't work with e.g. temporaries. I don't think we need to model the STL with ranges, it can be simpler and work with more types: https://godbolt.org/z/6ccGz35K7
I don't think we need to model the STL with ranges
enumerate is just the greatest pain point right now. I also want add some range algorithms and adaptors, they will all benefit readability of JSSC code a lot.
I've reevaluated my life choices and decided to go with Tim's simpler version.