提交 de96e5c8 编写于 作者: B Behdad Esfahbod

[Crap] Avoid operator=

上级 f9353bd6
......@@ -87,7 +87,7 @@ template <typename Type>
static inline Type& Crap (void) {
static_assert (sizeof (Type) <= HB_NULL_POOL_SIZE, "Increase HB_NULL_POOL_SIZE.");
Type *obj = reinterpret_cast<Type *> (_hb_CrapPool);
*obj = Null(Type);
memcpy (obj, &Null(Type), sizeof (*obj));
return *obj;
}
#define Crap(Type) Crap<typename hb_remove_const<typename hb_remove_reference<Type>::value>::value>()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册