From 71208e5047c71108dec7361fd7c3e594c8b6c2d8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 14 May 2019 22:51:59 -0700 Subject: [PATCH] Move OffsetTo<> deref operators in-class as friends --- src/hb-open-type.hh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 57b22a8e3..6c888f6bb 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -279,6 +279,11 @@ struct OffsetTo : Offset return StructAtOffset (base, *this); } + template + friend const Type& operator + (const Base *base, const OffsetTo &offset) { return offset (base); } + template + friend Type& operator + (Base *base, OffsetTo &offset) { return offset (base); } + Type& serialize (hb_serialize_context_t *c, const void *base) { return * (Type *) Offset::serialize (c, base); @@ -357,11 +362,6 @@ using NNOffsetTo = OffsetTo; template using LNNOffsetTo = LOffsetTo; -template -static inline const Type& operator + (const Base &base, const OffsetTo &offset) { return offset (base); } -template -static inline Type& operator + (Base &base, OffsetTo &offset) { return offset (base); } - /* * Array Types