Files
tp/include/JSystem/JGadget/pointer.h
T
kipcode66 3b26aae532 Improving standard compiler compatibility (#2926)
* Adding explicit dolphin/ prefix & fix characters

* Rename ShiftJIS to SJIS

* Separate JASSeqReader read methods implementation between compilers.

* Fix pointer.h

* fix d_item_data typo

* fix gcn matching issue
2025-12-08 20:31:22 -08:00

34 lines
533 B
C++

#ifndef POINTER_H
#define POINTER_H
namespace JGadget {
template<class T>
class TPointer {
public:
TPointer(T* ptr) : mPtr(ptr) {}
~TPointer() {}
void set(T* ptr) { mPtr = ptr; }
T* mPtr;
};
template<class T>
class TPointer_delete : public TPointer<T> {
public:
#ifdef __MWERKS__
TPointer_delete(T* ptr) : TPointer(ptr) {}
~TPointer_delete() {
delete mPtr;
}
#else
TPointer_delete(T* ptr) : TPointer<T>(ptr) {}
~TPointer_delete() {
delete this->mPtr;
}
#endif
};
}
#endif