Add CrapOrNull

pull/1042/head
Behdad Esfahbod 7 years ago
parent 251cc977e9
commit d600e844aa
  1. 11
      src/hb-private.hh

@ -605,6 +605,17 @@ static inline Type& Crap (void) {
}
#define Crap(Type) Crap<Type>()
template <typename Type>
struct CrapOrNull {
static inline Type & get (void) { return Crap(Type); }
};
template <typename Type>
struct CrapOrNull<const Type> {
static inline Type const & get (void) { return Null(Type); }
};
#define CrapOrNull(Type) CrapOrNull<Type>::get ()
/* arrays and maps */

Loading…
Cancel
Save