Minor: Use template parameter default values for hb_prealloced_array_t

This commit is contained in:
Behdad Esfahbod 2014-06-26 19:10:21 -04:00
parent 911ca38645
commit 546b1adcdc
1 changed files with 4 additions and 5 deletions

View File

@ -272,7 +272,7 @@ typedef int (*hb_compare_func_t) (const void *, const void *);
#define HB_PREALLOCED_ARRAY_INIT {0}
template <typename Type, unsigned int StaticSize>
template <typename Type, unsigned int StaticSize=16>
struct hb_prealloced_array_t
{
unsigned int len;
@ -383,12 +383,11 @@ struct hb_prealloced_array_t
}
};
#define HB_AUTO_ARRAY_PREALLOCED 16
template <typename Type>
struct hb_auto_array_t : hb_prealloced_array_t <Type, HB_AUTO_ARRAY_PREALLOCED>
struct hb_auto_array_t : hb_prealloced_array_t <Type>
{
hb_auto_array_t (void) { hb_prealloced_array_t<Type, HB_AUTO_ARRAY_PREALLOCED>::init (); }
~hb_auto_array_t (void) { hb_prealloced_array_t<Type, HB_AUTO_ARRAY_PREALLOCED>::finish (); }
hb_auto_array_t (void) { hb_prealloced_array_t<Type>::init (); }
~hb_auto_array_t (void) { hb_prealloced_array_t<Type>::finish (); }
};