Expand CStateManager.

- Expand ct/dt
- Add AllocateUniqueId
- Add rstl::set, multimap, reserved_vector::resize


Former-commit-id: 92def96f31
This commit is contained in:
Henrique Gemignani Passos Lima
2022-11-15 15:45:15 +02:00
parent e02198a8c9
commit 45ec66abc2
14 changed files with 189 additions and 37 deletions

View File

@@ -27,6 +27,7 @@ public:
reserved_vector() : x0_count(0) {}
explicit reserved_vector(const T& value) : x0_count(N) { uninitialized_fill_n(data(), N, value); }
explicit reserved_vector(int count, const T& value);
reserved_vector(const reserved_vector& other) : x0_count(other.x0_count) {
uninitialized_copy_n(other.data(), x0_count, data());
}
@@ -81,7 +82,20 @@ public:
--x0_count;
}
}
void resize(int count, const T& item) {
if (size() < count) {
uninitialized_fill_n(end(), count - size(), item);
x0_count = count;
}
}
};
template < typename T, int N >
reserved_vector< T, N >::reserved_vector(int count, const T& value) : x0_count(count) {
uninitialized_fill_n(data(), count, value);
}
} // namespace rstl
#endif // _RSTL_RESERVED_VECTOR