diff --git a/src/Memory/__UniquePtr.hpp b/src/Memory/__UniquePtr.hpp index c47b73a..8012b85 100644 --- a/src/Memory/__UniquePtr.hpp +++ b/src/Memory/__UniquePtr.hpp @@ -17,11 +17,12 @@ namespace ArbUt { public: inline UniquePtr() {} /// @brief Initialise a UniquePtr with a specific raw pointer. - inline UniquePtr(T* non_null ptr) : _raw(ptr) { EnsureNotNull(ptr); }; + inline UniquePtr(T* non_null ptr) : _raw(ptr) { EnsureNotNull(ptr) }; NO_COPY_OR_MOVE(UniquePtr) #if !WINDOWS // This doesn't work on mingw-w64 for some reason + /// @brief Do not allow nullreference assignment UniquePtr(std::nullptr_t) = delete; #endif diff --git a/src/Misc.hpp b/src/Misc.hpp index 378672d..61efbbe 100644 --- a/src/Misc.hpp +++ b/src/Misc.hpp @@ -2,9 +2,13 @@ #define ARBUTILS_MISC_HPP #define NO_COPY_OR_MOVE(type) \ + /* @brief: Copying is not allowed */ \ type(const type&) = delete; \ + /* @brief: Copying is not allowed */ \ type(type&&) = delete; \ + /* @brief: Copy assignment is not allowed */ \ type& operator=(const type&) = delete; \ + /* @brief: Copy assignment is not allowed */ \ type& operator=(type&&) = delete; #endif // ARBUTILS_MISC_HPP