Added NO_COPY/NO_MOVE macros.

This commit is contained in:
hyzboy 2024-10-18 22:50:28 +08:00
parent 09d777261f
commit 8c04edd669
3 changed files with 12 additions and 1 deletions

View File

@ -276,5 +276,12 @@ namespace hgl
#else
#define __HGL_FUNC__ __FUNCTION__
#endif//
#define NO_COPY(className) className(const className &)=delete; \
className &operator=(const className &)=delete;
#define NO_MOVE(className) className(className &&)=delete; \
className &operator=(className &&)=delete;
}//namespace hgl
#endif//HGL_PLATFORM_INCLUDE

View File

@ -1,6 +1,7 @@
#ifndef HGL_DATATYPE_INCLUDE
#define HGL_DATATYPE_INCLUDE
#include<hgl/type/TypeInfo.h>
#include<hgl/platform/Platform.h> // 平台定义
#include<hgl/Macro.h> // 常用宏定义
#include<hgl/type/Smart.h> // 智能指针

View File

@ -1,5 +1,5 @@
#pragma once
#include<hgl/type/TypeInfo.h>
#include<hgl/type/DataType.h>
#include<hgl/type/object/ObjectBaseInfo.h>
namespace hgl
@ -25,6 +25,9 @@ namespace hgl
template<typename T> friend class SafePtr;
template<typename T> friend struct DefaultObjectAllocator;
NO_COPY(Object)
NO_MOVE(Object)
Object(const ObjectBaseInfo &obi) noexcept { object_base_info=obi; }
virtual ~Object()=default;