diff --git a/inc/hgl/platform/Platform.h b/inc/hgl/platform/Platform.h index fbf0757..bc7b370 100644 --- a/inc/hgl/platform/Platform.h +++ b/inc/hgl/platform/Platform.h @@ -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 diff --git a/inc/hgl/type/DataType.h b/inc/hgl/type/DataType.h index 40ac7b7..038ea7f 100644 --- a/inc/hgl/type/DataType.h +++ b/inc/hgl/type/DataType.h @@ -1,6 +1,7 @@ #ifndef HGL_DATATYPE_INCLUDE #define HGL_DATATYPE_INCLUDE +#include #include // 平台定义 #include // 常用宏定义 #include // 智能指针 diff --git a/inc/hgl/type/object/Object.h b/inc/hgl/type/object/Object.h index bfc92c9..bc42e6d 100644 --- a/inc/hgl/type/object/Object.h +++ b/inc/hgl/type/object/Object.h @@ -1,5 +1,5 @@ #pragma once -#include +#include #include namespace hgl @@ -25,6 +25,9 @@ namespace hgl template friend class SafePtr; template friend struct DefaultObjectAllocator; + NO_COPY(Object) + NO_MOVE(Object) + Object(const ObjectBaseInfo &obi) noexcept { object_base_info=obi; } virtual ~Object()=default;