[array] Mark constructors constexpr

../src/hb-map.hh:44:38: note: non-constexpr constructor 'hb_array_t' cannot be used in a constant expression
  static constexpr K INVALID_KEY   = kINVALID;
                                     ^
This commit is contained in:
Behdad Esfahbod 2021-11-19 12:33:37 -07:00
parent 1da7423ed9
commit 4731b10736
1 changed files with 10 additions and 10 deletions

View File

@ -56,19 +56,19 @@ struct hb_array_t : hb_iter_with_fallback_t<hb_array_t<Type>, Type&>
hb_array_t& operator= (const hb_array_t&) = default; hb_array_t& operator= (const hb_array_t&) = default;
hb_array_t& operator= (hb_array_t&&) = default; hb_array_t& operator= (hb_array_t&&) = default;
hb_array_t (std::nullptr_t) : hb_array_t () {} constexpr hb_array_t (std::nullptr_t) : hb_array_t () {}
hb_array_t (Type *array_, unsigned int length_) : arrayZ (array_), length (length_) {} constexpr hb_array_t (Type *array_, unsigned int length_) : arrayZ (array_), length (length_) {}
template <unsigned int length_> template <unsigned int length_>
hb_array_t (Type (&array_)[length_]) : hb_array_t (array_, length_) {} constexpr hb_array_t (Type (&array_)[length_]) : hb_array_t (array_, length_) {}
template <typename U, template <typename U,
hb_enable_if (hb_is_cr_convertible(U, Type))> hb_enable_if (hb_is_cr_convertible(U, Type))>
hb_array_t (const hb_array_t<U> &o) : constexpr hb_array_t (const hb_array_t<U> &o) :
hb_iter_with_fallback_t<hb_array_t, Type&> (), hb_iter_with_fallback_t<hb_array_t, Type&> (),
arrayZ (o.arrayZ), length (o.length), backwards_length (o.backwards_length) {} arrayZ (o.arrayZ), length (o.length), backwards_length (o.backwards_length) {}
template <typename U, template <typename U,
hb_enable_if (hb_is_cr_convertible(U, Type))> hb_enable_if (hb_is_cr_convertible(U, Type))>
hb_array_t& operator = (const hb_array_t<U> &o) constexpr hb_array_t& operator = (const hb_array_t<U> &o)
{ arrayZ = o.arrayZ; length = o.length; backwards_length = o.backwards_length; return *this; } { arrayZ = o.arrayZ; length = o.length; backwards_length = o.backwards_length; return *this; }
/* /*
@ -314,19 +314,19 @@ struct hb_sorted_array_t :
hb_sorted_array_t& operator= (const hb_sorted_array_t&) = default; hb_sorted_array_t& operator= (const hb_sorted_array_t&) = default;
hb_sorted_array_t& operator= (hb_sorted_array_t&&) = default; hb_sorted_array_t& operator= (hb_sorted_array_t&&) = default;
hb_sorted_array_t (std::nullptr_t) : hb_sorted_array_t () {} constexpr hb_sorted_array_t (std::nullptr_t) : hb_sorted_array_t () {}
hb_sorted_array_t (Type *array_, unsigned int length_) : hb_array_t<Type> (array_, length_) {} constexpr hb_sorted_array_t (Type *array_, unsigned int length_) : hb_array_t<Type> (array_, length_) {}
template <unsigned int length_> template <unsigned int length_>
hb_sorted_array_t (Type (&array_)[length_]) : hb_array_t<Type> (array_) {} constexpr hb_sorted_array_t (Type (&array_)[length_]) : hb_array_t<Type> (array_) {}
template <typename U, template <typename U,
hb_enable_if (hb_is_cr_convertible(U, Type))> hb_enable_if (hb_is_cr_convertible(U, Type))>
hb_sorted_array_t (const hb_array_t<U> &o) : constexpr hb_sorted_array_t (const hb_array_t<U> &o) :
hb_iter_t<hb_sorted_array_t, Type&> (), hb_iter_t<hb_sorted_array_t, Type&> (),
hb_array_t<Type> (o) {} hb_array_t<Type> (o) {}
template <typename U, template <typename U,
hb_enable_if (hb_is_cr_convertible(U, Type))> hb_enable_if (hb_is_cr_convertible(U, Type))>
hb_sorted_array_t& operator = (const hb_array_t<U> &o) constexpr hb_sorted_array_t& operator = (const hb_array_t<U> &o)
{ hb_array_t<Type> (*this) = o; return *this; } { hb_array_t<Type> (*this) = o; return *this; }
/* Iterator implementation. */ /* Iterator implementation. */