Second pass idLib integration.

This commit is contained in:
Justin Marshall
2026-08-08 19:30:03 -07:00
parent 55a14323f2
commit 1b718f17f6
114 changed files with 9696 additions and 331 deletions
+29
View File
@@ -0,0 +1,29 @@
#pragma once
#include <cassert>
// All 82 recovered instantiations are exactly a fixed C array named ptr.
template<typename type, int count>
class idArray {
public:
static_assert(count > 0, "idArray requires a positive element count");
type ptr[count];
constexpr int Num() const { return count; }
type* Ptr() { return ptr; }
const type* Ptr() const { return ptr; }
type& operator[](const int index) {
assert(index >= 0 && index < count); return ptr[index];
}
const type& operator[](const int index) const {
assert(index >= 0 && index < count); return ptr[index];
}
type* begin() { return ptr; }
const type* begin() const { return ptr; }
type* end() { return ptr + count; }
const type* end() const { return ptr + count; }
};
static_assert(sizeof(idArray<int, 4>) == sizeof(int) * 4,
"Recovered idArray ABI changed");