Use injected class name to simplify macros

This commit is contained in:
Behdad Esfahbod 2019-04-11 11:20:10 -04:00
parent baf1e79075
commit b52c0e54b9
2 changed files with 5 additions and 19 deletions

View File

@ -378,7 +378,7 @@ struct UnsizedArrayOf
typedef Type item_t; typedef Type item_t;
static constexpr unsigned item_size = hb_static_size (Type); static constexpr unsigned item_size = hb_static_size (Type);
HB_DELETE_CREATE_COPY_ASSIGN_TEMPLATE (UnsizedArrayOf, Type); HB_DELETE_CREATE_COPY_ASSIGN (UnsizedArrayOf);
const Type& operator [] (int i_) const const Type& operator [] (int i_) const
{ {
@ -534,7 +534,7 @@ struct ArrayOf
typedef Type item_t; typedef Type item_t;
static constexpr unsigned item_size = hb_static_size (Type); static constexpr unsigned item_size = hb_static_size (Type);
HB_DELETE_CREATE_COPY_ASSIGN_TEMPLATE2 (ArrayOf, Type, LenType); HB_DELETE_CREATE_COPY_ASSIGN (ArrayOf);
const Type& operator [] (int i_) const const Type& operator [] (int i_) const
{ {
@ -715,7 +715,7 @@ struct HeadlessArrayOf
{ {
static constexpr unsigned item_size = Type::static_size; static constexpr unsigned item_size = Type::static_size;
HB_DELETE_CREATE_COPY_ASSIGN_TEMPLATE2 (HeadlessArrayOf, Type, LenType); HB_DELETE_CREATE_COPY_ASSIGN (HeadlessArrayOf);
const Type& operator [] (int i_) const const Type& operator [] (int i_) const
{ {
@ -780,7 +780,7 @@ struct HeadlessArrayOf
template <typename Type, typename LenType=HBUINT16> template <typename Type, typename LenType=HBUINT16>
struct ArrayOfM1 struct ArrayOfM1
{ {
HB_DELETE_CREATE_COPY_ASSIGN_TEMPLATE2 (ArrayOfM1, Type, LenType); HB_DELETE_CREATE_COPY_ASSIGN (ArrayOfM1);
const Type& operator [] (int i_) const const Type& operator [] (int i_) const
{ {
@ -945,7 +945,7 @@ struct VarSizedBinSearchArrayOf
{ {
static constexpr unsigned item_size = Type::static_size; static constexpr unsigned item_size = Type::static_size;
HB_DELETE_CREATE_COPY_ASSIGN_TEMPLATE (VarSizedBinSearchArrayOf, Type); HB_DELETE_CREATE_COPY_ASSIGN (VarSizedBinSearchArrayOf);
bool last_is_terminator () const bool last_is_terminator () const
{ {

View File

@ -411,24 +411,10 @@ static_assert ((sizeof (hb_var_int_t) == 4), "");
#define HB_DELETE_COPY_ASSIGN(TypeName) \ #define HB_DELETE_COPY_ASSIGN(TypeName) \
TypeName(const TypeName&) = delete; \ TypeName(const TypeName&) = delete; \
void operator=(const TypeName&) = delete void operator=(const TypeName&) = delete
#define HB_DELETE_COPY_ASSIGN_TEMPLATE(TypeName, T) \
TypeName(const TypeName<T>&) = delete; \
void operator=(const TypeName<T>&) = delete
#define HB_DELETE_COPY_ASSIGN_TEMPLATE2(TypeName, T1, T2) \
TypeName(const TypeName<T1, T2>&) = delete; \
void operator=(const TypeName<T1, T2>&) = delete
#define HB_DELETE_CREATE_COPY_ASSIGN(TypeName) \ #define HB_DELETE_CREATE_COPY_ASSIGN(TypeName) \
TypeName() = delete; \ TypeName() = delete; \
TypeName(const TypeName&) = delete; \ TypeName(const TypeName&) = delete; \
void operator=(const TypeName&) = delete void operator=(const TypeName&) = delete
#define HB_DELETE_CREATE_COPY_ASSIGN_TEMPLATE(TypeName, T) \
TypeName() = delete; \
TypeName(const TypeName<T>&) = delete; \
void operator=(const TypeName<T>&) = delete
#define HB_DELETE_CREATE_COPY_ASSIGN_TEMPLATE2(TypeName, T1, T2) \
TypeName() = delete; \
TypeName(const TypeName<T1, T2>&) = delete; \
void operator=(const TypeName<T1, T2>&) = delete
/* /*