Added NO_COPY/NO_MOVE macros.
This commit is contained in:
parent
09d777261f
commit
8c04edd669
@ -276,5 +276,12 @@ namespace hgl
|
|||||||
#else
|
#else
|
||||||
#define __HGL_FUNC__ __FUNCTION__
|
#define __HGL_FUNC__ __FUNCTION__
|
||||||
#endif//
|
#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
|
}//namespace hgl
|
||||||
#endif//HGL_PLATFORM_INCLUDE
|
#endif//HGL_PLATFORM_INCLUDE
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#ifndef HGL_DATATYPE_INCLUDE
|
#ifndef HGL_DATATYPE_INCLUDE
|
||||||
#define HGL_DATATYPE_INCLUDE
|
#define HGL_DATATYPE_INCLUDE
|
||||||
|
|
||||||
|
#include<hgl/type/TypeInfo.h>
|
||||||
#include<hgl/platform/Platform.h> // 平台定义
|
#include<hgl/platform/Platform.h> // 平台定义
|
||||||
#include<hgl/Macro.h> // 常用宏定义
|
#include<hgl/Macro.h> // 常用宏定义
|
||||||
#include<hgl/type/Smart.h> // 智能指针
|
#include<hgl/type/Smart.h> // 智能指针
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include<hgl/type/TypeInfo.h>
|
#include<hgl/type/DataType.h>
|
||||||
#include<hgl/type/object/ObjectBaseInfo.h>
|
#include<hgl/type/object/ObjectBaseInfo.h>
|
||||||
|
|
||||||
namespace hgl
|
namespace hgl
|
||||||
@ -25,6 +25,9 @@ namespace hgl
|
|||||||
template<typename T> friend class SafePtr;
|
template<typename T> friend class SafePtr;
|
||||||
template<typename T> friend struct DefaultObjectAllocator;
|
template<typename T> friend struct DefaultObjectAllocator;
|
||||||
|
|
||||||
|
NO_COPY(Object)
|
||||||
|
NO_MOVE(Object)
|
||||||
|
|
||||||
Object(const ObjectBaseInfo &obi) noexcept { object_base_info=obi; }
|
Object(const ObjectBaseInfo &obi) noexcept { object_base_info=obi; }
|
||||||
virtual ~Object()=default;
|
virtual ~Object()=default;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user