diff --git a/src/hb-ot-var-common.hh b/src/hb-ot-var-common.hh index d1c617e11..23d7f7cc3 100644 --- a/src/hb-ot-var-common.hh +++ b/src/hb-ot-var-common.hh @@ -1076,6 +1076,11 @@ struct TupleVariationData unsigned compiled_byte_size = 4; public: + tuple_variations_t () = default; + tuple_variations_t (const tuple_variations_t&) = delete; + tuple_variations_t& operator=(const tuple_variations_t&) = delete; + tuple_variations_t (tuple_variations_t&&) = default; + tuple_variations_t& operator=(tuple_variations_t&&) = default; ~tuple_variations_t () { fini (); } void fini () { diff --git a/src/hb-vector.hh b/src/hb-vector.hh index f41ea6f09..66e687a1a 100644 --- a/src/hb-vector.hh +++ b/src/hb-vector.hh @@ -208,25 +208,7 @@ struct hb_vector_t return std::addressof (Crap (Type)); return std::addressof (arrayZ[length - 1]); } - template ::value && - std::is_copy_assignable::value)> - Type *push (T&& v) - { - Type *p = push (); - if (p == std::addressof (Crap (Type))) - // If push failed to allocate then don't copy v, since this may cause - // the created copy to leak memory since we won't have stored a - // reference to it. - return p; - *p = std::forward (v); - return p; - } - template ::value)> - Type *push (T&& v) + template Type *push (Args&&... args) { if (unlikely ((int) length >= allocated && !alloc (length + 1))) // If push failed to allocate then don't copy v, since this may cause @@ -236,7 +218,7 @@ struct hb_vector_t /* Emplace. */ Type *p = std::addressof (arrayZ[length++]); - return new (p) Type (std::forward (v)); + return new (p) Type (std::forward (args)...); } bool in_error () const { return allocated < 0; }