template <typename Type>
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) {}
template <typename Type>
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);
template <typename Type, typename LenType=HBUINT16>
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);
template <typename Type, unsigned int PreallocedCount=8>
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 (); }