From 2eda2ab3bbd2f2013457797727f9bee6ec103179 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 18 Aug 2022 16:15:54 -0600 Subject: [PATCH] [object] Forward hb_object_create() arguments to constructor --- src/hb-object.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hb-object.hh b/src/hb-object.hh index bc37cc5ae..9876c2923 100644 --- a/src/hb-object.hh +++ b/src/hb-object.hh @@ -214,15 +214,15 @@ static inline void hb_object_trace (const Type *obj, const char *function) obj ? obj->header.ref_count.get_relaxed () : 0); } -template -static inline Type *hb_object_create () +template +static inline Type *hb_object_create (Ts... ds) { Type *obj = (Type *) hb_calloc (1, sizeof (Type)); if (unlikely (!obj)) return obj; - new (obj) Type; + new (obj) Type (std::forward (ds)...); hb_object_init (obj); hb_object_trace (obj, HB_FUNC);