mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-22 23:41:03 +01:00
Add CrapOrNull
This commit is contained in:
1 parent
251cc977e9
commit
d600e844aa
1 file changed
+11
@@ -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 */
|
||||
|
||||
|
||||
Reference in new issue
Block a user