mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-12-10 13:47:42 +00:00
Expand CStateManager.
- Expand ct/dt
- Add AllocateUniqueId
- Add rstl::set, multimap, reserved_vector::resize
Former-commit-id: 92def96f31
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user