Create EnumMap

This commit is contained in:
Pokechu22
2021-04-24 19:26:27 -07:00
parent a80fcf38ae
commit ba107819ec
6 changed files with 122 additions and 8 deletions

View File

@ -27,6 +27,7 @@
#include "Common/Assert.h"
#include "Common/CommonTypes.h"
#include "Common/EnumMap.h"
#include "Common/Flag.h"
#include "Common/Inline.h"
#include "Common/Logging/Log.h"
@ -175,6 +176,12 @@ public:
DoArray(x.data(), static_cast<u32>(x.size()));
}
template <typename V, auto last_member, typename = decltype(last_member)>
void DoArray(Common::EnumMap<V, last_member>& x)
{
DoArray(x.data(), static_cast<u32>(x.size()));
}
template <typename T, typename std::enable_if_t<std::is_trivially_copyable_v<T>, int> = 0>
void DoArray(T* x, u32 count)
{