[Crap] Avoid operator=
This commit is contained in:
parent
f9353bd68c
commit
de96e5c81c
|
@ -87,7 +87,7 @@ template <typename Type>
|
||||||
static inline Type& Crap (void) {
|
static inline Type& Crap (void) {
|
||||||
static_assert (sizeof (Type) <= HB_NULL_POOL_SIZE, "Increase HB_NULL_POOL_SIZE.");
|
static_assert (sizeof (Type) <= HB_NULL_POOL_SIZE, "Increase HB_NULL_POOL_SIZE.");
|
||||||
Type *obj = reinterpret_cast<Type *> (_hb_CrapPool);
|
Type *obj = reinterpret_cast<Type *> (_hb_CrapPool);
|
||||||
*obj = Null(Type);
|
memcpy (obj, &Null(Type), sizeof (*obj));
|
||||||
return *obj;
|
return *obj;
|
||||||
}
|
}
|
||||||
#define Crap(Type) Crap<typename hb_remove_const<typename hb_remove_reference<Type>::value>::value>()
|
#define Crap(Type) Crap<typename hb_remove_const<typename hb_remove_reference<Type>::value>::value>()
|
||||||
|
|
Loading…
Reference in New Issue