mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-12-10 08:27:41 +00:00
Add headers, clang-format, decompctx.py & more
This commit is contained in:
24
include/rstl/single_ptr.hpp
Normal file
24
include/rstl/single_ptr.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef _RSTL_SINGLE_PTR_HPP
|
||||
#define _RSTL_SINGLE_PTR_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
namespace rstl {
|
||||
template < typename T >
|
||||
class single_ptr {
|
||||
T* x0_ptr;
|
||||
|
||||
public:
|
||||
single_ptr() : x0_ptr(nullptr) {}
|
||||
single_ptr(T* ptr) : x0_ptr(ptr) {}
|
||||
~single_ptr() { delete x0_ptr; }
|
||||
T* get() { return x0_ptr; }
|
||||
T* operator->() { return x0_ptr; }
|
||||
void operator=(T* ptr) {
|
||||
delete x0_ptr;
|
||||
x0_ptr = ptr;
|
||||
}
|
||||
};
|
||||
} // namespace rstl
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user