pcsx2
pcsx2 copied to clipboard
Common: Add ArrayRef and use it for GL::Context
Description of Changes
- Adds LLVM's ArrayRef to Common
- Switches GL::Context's pointer + length usage to ArrayRef
Rationale behind Changes
- Can use C++ iteration now
- The length of the return of
GL::Context::GetAllVersionsListis no longer part of its type
Suggested Testing Steps
Launch the emulator with a GL backend
There is also std::span/gsl::span, from what I can see by briefly looking into this code they are equivalent?
https://github.com/microsoft/GSL/blob/main/include/gsl/span
std::span is C++20 so that might be a dealbreaker, but I think gsl::span has an identical API so that'd make potential future migration simplistic.
EDIT: gsl::span also has bounds checks:
https://github.com/microsoft/GSL/wiki/gsl::span-and-std::span
Switched to gsl