Modernize range operations
Use std::ranges where possible
I think this has potential to go further. The ranges versions of standard algorithms can do more than just eliminate the redundant begin() and end() calls when iterating through an entire container. There's also range projections, a useful optional parameter for when only a sub-member is needed. On short notice, I found a blog post that explains how they work if you weren't already aware.
Similar to my suggestion for the unused header culling, splitting this into the different sectors of Dolphin's codebase would be helpful for review purposes.
Some places where std::as_const was added must be missing the <utility> header. I think using std::as_const isn't necessary, anyway. JetBrains is just trying to uphold the intent of the code originally using cbegin() and cend().
@dolphin-emu-bot rebuild.
Do you know how to use clang-format in JetBrains, or are you manually editing to match what the buildbot says is correct? If the latter, I encourage you to stop and figure out how to set up format on save. It will save you a lot of time down the line.
Saving with no new changes might not do the formatting needed, so you may need to format the document with a shortcut, e.g. on VS Code it's Ctrl + Shift + I.
Are you manually editing to match what the buildbot says is correct?
Yes, I'm having some issues with the automatic formatting. Jetbrains suggests wrong formatting most of the time. I'll look into fixing it later today.
@dolphin-emu-bot rebuild
@tygyh As I mentioned, there is more that can be done with the ranges library which this PR misses out on, and rather than dictating to you over GitHub which changes I want where and how it would be best to split this PR (currently, it is a lot of lines and files changed), I think I would rather take the helm with these proposed changes. Would you be offended if I went ahead with this?
Would you be offended if I went ahead with this?
Go ahead,just link to this in the description.