Add operator char * to hb_nonnull_ptr_t

This commit is contained in:
Behdad Esfahbod 2018-11-03 16:02:03 -04:00
parent 7430ff604a
commit d6fdae310f
1 changed files with 4 additions and 4 deletions

View File

@ -120,10 +120,10 @@ struct hb_nonnull_ptr_t
inline const T & operator * (void) const { return *get (); } inline const T & operator * (void) const { return *get (); }
inline T ** operator & (void) { return &v; } inline T ** operator & (void) { return &v; }
inline const T ** operator & (void) const { return &v; } inline const T ** operator & (void) const { return &v; }
template <typename C> template <typename C> inline operator C * (void) { return get (); }
inline operator C * (void) { return get (); } template <typename C> inline operator const C * (void) const { return get (); }
template <typename C> inline operator char * (void) { return (char *) get (); }
inline operator const C * (void) const { return get (); } inline operator const char * (void) const { return (const char *) get (); }
inline T * get (void) { return v ? v : const_cast<T *> (&Null(T)); } inline T * get (void) { return v ? v : const_cast<T *> (&Null(T)); }
inline const T * get (void) const { return v ? v : const_cast<T *> (&Null(T)); } inline const T * get (void) const { return v ? v : const_cast<T *> (&Null(T)); }
inline T * get_raw (void) { return v; } inline T * get_raw (void) { return v; }