mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-12-09 00:27:40 +00:00
Implement TObj*/IObj; finish matching CStringTable
This commit is contained in:
@@ -6,13 +6,33 @@
|
||||
namespace rstl {
|
||||
template < typename T >
|
||||
class auto_ptr {
|
||||
bool x0_has;
|
||||
T* x4_item;
|
||||
mutable bool x0_has;
|
||||
mutable T* x4_item;
|
||||
|
||||
public:
|
||||
auto_ptr() : x0_has(false), x4_item(nullptr) {}
|
||||
auto_ptr(T* ptr) : x0_has(ptr != nullptr), x4_item(ptr) {}
|
||||
~auto_ptr() {
|
||||
if (x0_has) {
|
||||
delete x4_item;
|
||||
}
|
||||
}
|
||||
// TODO check
|
||||
// auto_ptr(const auto_ptr& other) : x0_has(other.x0_has), x4_item(other.x4_item) {
|
||||
// other.x0_has = false;
|
||||
// }
|
||||
// TODO check
|
||||
// auto_ptr& operator=(const auto_ptr& other) {
|
||||
// x0_has = other.x4_item != nullptr;
|
||||
// x4_item = other.x4_item;
|
||||
// other.x0_has = false;
|
||||
// }
|
||||
T* get() { return x4_item; }
|
||||
T* operator->() { return get(); }
|
||||
T* release() const {
|
||||
x0_has = false;
|
||||
return x4_item;
|
||||
}
|
||||
};
|
||||
} // namespace rstl
|
||||
|
||||
|
||||
Reference in New Issue
Block a user