mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-20 01:01:40 +00:00
Common/CommonFuncs: Remove now-unneccessary ArraySize function
Since C++17, non-member std::size() is present in the standard library which also operates on regular C arrays. Given that, we can just replace usages of ArraySize with that where applicable. In many cases, we can just change the actual C array ArraySize() was called on into a std::array and just use its .size() member function instead. In some other cases, we can collapse the loops they were used in, into a ranged-for loop, eliminating the need for en explicit bounds query.
This commit is contained in:
parent
a4837a5c5d
commit
a9663669dc
26 changed files with 280 additions and 229 deletions
|
@ -4,17 +4,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
// Will fail to compile on a non-array:
|
||||
template <typename T, size_t N>
|
||||
constexpr size_t ArraySize(T (&arr)[N])
|
||||
{
|
||||
return N;
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
// go to debugger mode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue