From 1da7423ed9d96c6ed8000f2c6a971bc3ce65cb2b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 19 Nov 2021 12:11:41 -0700 Subject: [PATCH] [array] Add constructor taking std::nullptr_t Not all impls implement nullptr_t in a way that would automatically convert to what we were accepting. In file included from ../src/test-map.cc:27: ../src/hb-map.hh:44:22: error: no viable conversion from 'nullptr_t' to 'const hb_array_t' static constexpr K INVALID_KEY = kINVALID; ^ ~~~~~~~~ --- src/hb-array.hh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hb-array.hh b/src/hb-array.hh index bf5b99049..aa9508fc5 100644 --- a/src/hb-array.hh +++ b/src/hb-array.hh @@ -56,6 +56,7 @@ struct hb_array_t : hb_iter_with_fallback_t, Type&> hb_array_t& operator= (const hb_array_t&) = default; hb_array_t& operator= (hb_array_t&&) = default; + hb_array_t (std::nullptr_t) : hb_array_t () {} hb_array_t (Type *array_, unsigned int length_) : arrayZ (array_), length (length_) {} template hb_array_t (Type (&array_)[length_]) : hb_array_t (array_, length_) {} @@ -313,6 +314,7 @@ struct hb_sorted_array_t : 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 (std::nullptr_t) : hb_sorted_array_t () {} hb_sorted_array_t (Type *array_, unsigned int length_) : hb_array_t (array_, length_) {} template hb_sorted_array_t (Type (&array_)[length_]) : hb_array_t (array_) {}