Allow blank constructors for pointer types.
This commit is contained in:
parent
d46b0d798a
commit
6c5fe1bf93
|
@ -6,6 +6,7 @@ namespace Arbutils::Memory {
|
||||||
T* _ptr;
|
T* _ptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
inline BorrowedPtr() {};
|
||||||
inline explicit constexpr BorrowedPtr(T* ptr) noexcept : _ptr(ptr){};
|
inline explicit constexpr BorrowedPtr(T* ptr) noexcept : _ptr(ptr){};
|
||||||
|
|
||||||
inline constexpr T* GetUnsafe() noexcept { return _ptr; }
|
inline constexpr T* GetUnsafe() noexcept { return _ptr; }
|
||||||
|
|
|
@ -9,6 +9,7 @@ namespace Arbutils::Memory {
|
||||||
T* _ptr;
|
T* _ptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
inline NonNullBorrowedPtr() {};
|
||||||
inline explicit NonNullBorrowedPtr(T* ptr) : _ptr(ptr){
|
inline explicit NonNullBorrowedPtr(T* ptr) : _ptr(ptr){
|
||||||
AssertNotNull(ptr);
|
AssertNotNull(ptr);
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,6 +10,7 @@ namespace Arbutils::Memory {
|
||||||
T* _ptr;
|
T* _ptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
inline NonNullOwnPtr() {};
|
||||||
inline explicit NonNullOwnPtr(T* ptr) : _ptr(ptr) { AssertNotNull(ptr); };
|
inline explicit NonNullOwnPtr(T* ptr) : _ptr(ptr) { AssertNotNull(ptr); };
|
||||||
|
|
||||||
NonNullOwnPtr<T>(const NonNullOwnPtr<T>&) = delete;
|
NonNullOwnPtr<T>(const NonNullOwnPtr<T>&) = delete;
|
||||||
|
|
|
@ -9,6 +9,7 @@ namespace Arbutils::Memory {
|
||||||
T* _ptr;
|
T* _ptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
inline OwnPtr() {};
|
||||||
inline explicit constexpr OwnPtr(T* ptr) noexcept : _ptr(ptr){};
|
inline explicit constexpr OwnPtr(T* ptr) noexcept : _ptr(ptr){};
|
||||||
|
|
||||||
OwnPtr<T>(const OwnPtr<T>&) = delete;
|
OwnPtr<T>(const OwnPtr<T>&) = delete;
|
||||||
|
|
Loading…
Reference in New Issue