Implement TObj*/IObj; finish matching CStringTable

This commit is contained in:
2022-07-14 12:24:26 -04:00
parent 2ce22743e9
commit e98f62c3a6
51 changed files with 437 additions and 436 deletions

View File

@@ -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