Another try
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 15 May 2019 08:15:11 +0000 (01:15 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 15 May 2019 08:21:32 +0000 (01:21 -0700)
src/hb-open-type.hh

index 57b22a8..ec7b5db 100644 (file)
@@ -279,6 +279,11 @@ struct OffsetTo : Offset<OffsetType, has_null>
     return StructAtOffset<Type> (base, *this);
   }
 
+  template <typename Base>
+  friend const Type& operator + (const Base &base, const OffsetTo &offset) { return offset (base); }
+  template <typename Base>
+  friend Type& operator + (Base &base, OffsetTo &offset) { return offset (base); }
+
   Type& serialize (hb_serialize_context_t *c, const void *base)
   {
     return * (Type *) Offset<OffsetType>::serialize (c, base);
@@ -357,11 +362,6 @@ using NNOffsetTo = OffsetTo<Type, OffsetType, false>;
 template <typename Type>
 using LNNOffsetTo = LOffsetTo<Type, false>;
 
-template <typename Base, typename OffsetType, bool has_null, typename Type>
-static inline const Type& operator + (const Base &base, const OffsetTo<Type, OffsetType, has_null> &offset) { return offset (base); }
-template <typename Base, typename OffsetType, bool has_null, typename Type>
-static inline Type& operator + (Base &base, OffsetTo<Type, OffsetType, has_null> &offset) { return offset (base); }
-
 
 /*
  * Array Types