mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-24 08:21:32 +01:00
[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<const char>'
static constexpr K INVALID_KEY = kINVALID;
^ ~~~~~~~~
This commit is contained in:
1 parent
e456922a76
commit
1da7423ed9
1 file changed
+2
@@ -56,6 +56,7 @@ 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= (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 <unsigned int length_>
|
||||
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<Type> (array_, length_) {}
|
||||
template <unsigned int length_>
|
||||
hb_sorted_array_t (Type (&array_)[length_]) : hb_array_t<Type> (array_) {}
|
||||
|
||||
Reference in new issue
Block a user