Add explicit_operator
Fixes https://github.com/harfbuzz/harfbuzz/issues/1127
This commit is contained in:
parent
470acb6c32
commit
f9a3eab810
|
@ -72,7 +72,7 @@ struct Iter<T *>
|
||||||
array (array_), length (length_) {}
|
array (array_), length (length_) {}
|
||||||
|
|
||||||
/* Emptiness. */
|
/* Emptiness. */
|
||||||
inline operator bool (void) const { return bool (length); }
|
explicit_operator inline operator bool (void) const { return bool (length); }
|
||||||
|
|
||||||
/* Current item. */
|
/* Current item. */
|
||||||
inline T &operator * (void)
|
inline T &operator * (void)
|
||||||
|
|
|
@ -125,7 +125,20 @@ struct _hb_alignof
|
||||||
#define alignof(x) (_hb_alignof<x>::value)
|
#define alignof(x) (_hb_alignof<x>::value)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // __cplusplus < 201103L
|
/* https://github.com/harfbuzz/harfbuzz/issues/1127 */
|
||||||
|
#ifndef explicit_operator
|
||||||
|
#define explicit_operator
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else /* __cplusplus >= 201103L */
|
||||||
|
|
||||||
|
/* https://github.com/harfbuzz/harfbuzz/issues/1127 */
|
||||||
|
#ifndef explicit_operator
|
||||||
|
#define explicit_operator explicit
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __cplusplus < 201103L */
|
||||||
|
|
||||||
|
|
||||||
#if (defined(__GNUC__) || defined(__clang__)) && defined(__OPTIMIZE__)
|
#if (defined(__GNUC__) || defined(__clang__)) && defined(__OPTIMIZE__)
|
||||||
#define likely(expr) (__builtin_expect (!!(expr), 1))
|
#define likely(expr) (__builtin_expect (!!(expr), 1))
|
||||||
|
|
Loading…
Reference in New Issue