Minor change to explicit_operator aesthetics

This commit is contained in:
Behdad Esfahbod 2018-12-16 14:27:43 -05:00
parent b2ebaa9afa
commit 01d06e34ff
4 changed files with 6 additions and 6 deletions

View File

@ -72,7 +72,7 @@ struct Iter<T *>
array (array_), length (length_) {}
/* Emptiness. */
explicit_operator operator bool (void) const { return bool (length); }
explicit_operator bool (void) const { return bool (length); }
/* Current item. */
T &operator * (void)

View File

@ -834,7 +834,7 @@ struct hb_lazy_loader_t : hb_data_wrapper_t<Data, WheresData>
const Returned * operator -> (void) const { return get (); }
const Returned & operator * (void) const { return *get (); }
explicit_operator operator bool (void) const
explicit_operator bool (void) const
{ return get_stored () != Funcs::get_null (); }
template <typename C> operator const C * (void) const { return get (); }

View File

@ -121,8 +121,8 @@ struct hb_vector_t
hb_array_t<Type> sorted_sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */)
{ return as_sorted_array ().sorted_sub_array (start_offset, count);}
template <typename T> explicit_operator operator T * (void) { return arrayZ(); }
template <typename T> explicit_operator operator const T * (void) const { return arrayZ(); }
template <typename T> explicit_operator T * (void) { return arrayZ(); }
template <typename T> explicit_operator const T * (void) const { return arrayZ(); }
operator hb_array_t<Type> (void) { return as_array (); }
operator hb_array_t<const Type> (void) const { as_array (); }

View File

@ -137,14 +137,14 @@ struct _hb_alignof
/* https://github.com/harfbuzz/harfbuzz/issues/1127 */
#ifndef explicit_operator
#define explicit_operator
#define explicit_operator operator
#endif
#else /* __cplusplus >= 201103L */
/* https://github.com/harfbuzz/harfbuzz/issues/1127 */
#ifndef explicit_operator
#define explicit_operator explicit
#define explicit_operator explicit operator
#endif
#endif /* __cplusplus < 201103L */