加入 Node节点类 还未测试新框架
This commit is contained in:
26
source/EngineFrame/Attribute/Bits.h
Normal file
26
source/EngineFrame/Attribute/Bits.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
#include <type_traits>
|
||||
|
||||
namespace bits
|
||||
{
|
||||
template <typename _Ty>
|
||||
inline void Set(_Ty &old, _Ty flag)
|
||||
{
|
||||
static_assert(std::is_arithmetic<_Ty>::value, "_Ty must be an arithmetic type");
|
||||
old |= flag;
|
||||
}
|
||||
|
||||
template <typename _Ty>
|
||||
inline void Unset(_Ty &old, _Ty flag)
|
||||
{
|
||||
static_assert(std::is_arithmetic<_Ty>::value, "_Ty must be an arithmetic type");
|
||||
old &= ~flag;
|
||||
}
|
||||
|
||||
template <typename _Ty>
|
||||
inline bool Has(_Ty old, _Ty flag)
|
||||
{
|
||||
static_assert(std::is_arithmetic<_Ty>::value, "_Ty must be an arithmetic type");
|
||||
return !!(old & flag);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user