diff --git a/src/hb-array.hh b/src/hb-array.hh index fd3bd4450..2fc50ed32 100644 --- a/src/hb-array.hh +++ b/src/hb-array.hh @@ -69,7 +69,8 @@ struct hb_sorted_array_t; template struct hb_array_t { - static_assert ((bool) (unsigned) hb_static_size (Type), ""); + typedef Type ItemType; + enum { item_size = hb_static_size (Type) }; hb_array_t (void) : arrayZ (nullptr), len (0) {} hb_array_t (const hb_array_t &o) : arrayZ (o.arrayZ), len (o.len) {} diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index e4f4eb9a9..67962eef2 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -352,9 +352,8 @@ static inline Type& operator + (Base &base, OffsetTo template struct UnsizedArrayOf { - static_assert ((bool) (unsigned) hb_static_size (Type), ""); - - enum { item_size = Type::static_size }; + typedef Type ItemType; + enum { item_size = hb_static_size (Type) }; HB_NO_CREATE_COPY_ASSIGN_TEMPLATE (UnsizedArrayOf, Type); @@ -509,9 +508,8 @@ struct SortedUnsizedArrayOf : UnsizedArrayOf template struct ArrayOf { - static_assert ((bool) (unsigned) hb_static_size (Type), ""); - - enum { item_size = Type::static_size }; + typedef Type ItemType; + enum { item_size = hb_static_size (Type) }; HB_NO_CREATE_COPY_ASSIGN_TEMPLATE2 (ArrayOf, Type, LenType); diff --git a/src/hb-vector.hh b/src/hb-vector.hh index cc45be206..60161047e 100644 --- a/src/hb-vector.hh +++ b/src/hb-vector.hh @@ -34,10 +34,8 @@ template struct hb_vector_t { - static_assert ((bool) (unsigned) hb_static_size (Type), ""); - typedef Type ItemType; - enum { item_size = sizeof (Type) }; + enum { item_size = hb_static_size (Type) }; HB_NO_COPY_ASSIGN_TEMPLATE2 (hb_vector_t, Type, PreallocedCount); hb_vector_t (void) { init (); }