[arrays] Add not_found to reference bsearch as well
This commit is contained in:
parent
d77a098b73
commit
918b1ee54d
|
@ -469,11 +469,11 @@ struct SortedUnsizedArrayOf : UnsizedArrayOf<Type>
|
||||||
{ return hb_sorted_array (this->arrayZ, len); }
|
{ return hb_sorted_array (this->arrayZ, len); }
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline Type &bsearch (unsigned int len, const T &x)
|
inline Type &bsearch (unsigned int len, const T &x, Type ¬_found = Crap (Type))
|
||||||
{ return *as_array (len).bsearch (x, &Crap (Type)); }
|
{ return *as_array (len).bsearch (x, ¬_found); }
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline const Type &bsearch (unsigned int len, const T &x) const
|
inline const Type &bsearch (unsigned int len, const T &x, const Type ¬_found = Null (Type)) const
|
||||||
{ return *as_array (len).bsearch (x, &Null (Type)); }
|
{ return *as_array (len).bsearch (x, ¬_found); }
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline bool bfind (unsigned int len, const T &x, unsigned int *i = nullptr,
|
inline bool bfind (unsigned int len, const T &x, unsigned int *i = nullptr,
|
||||||
hb_bfind_not_found_t not_found = HB_BFIND_NOT_FOUND_DONT_STORE,
|
hb_bfind_not_found_t not_found = HB_BFIND_NOT_FOUND_DONT_STORE,
|
||||||
|
@ -778,11 +778,11 @@ struct SortedArrayOf : ArrayOf<Type, LenType>
|
||||||
{ return hb_sorted_array (this->arrayZ, this->len); }
|
{ return hb_sorted_array (this->arrayZ, this->len); }
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline Type &bsearch (const T &x)
|
inline Type &bsearch (const T &x, Type ¬_found = Crap (Type))
|
||||||
{ return *as_array ().bsearch (x, &Crap (Type)); }
|
{ return *as_array ().bsearch (x, ¬_found); }
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline const Type &bsearch (const T &x) const
|
inline const Type &bsearch (const T &x, const Type ¬_found = Null (Type)) const
|
||||||
{ return *as_array ().bsearch (x, &Null (Type)); }
|
{ return *as_array ().bsearch (x, ¬_found); }
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline bool bfind (const T &x, unsigned int *i = nullptr,
|
inline bool bfind (const T &x, unsigned int *i = nullptr,
|
||||||
hb_bfind_not_found_t not_found = HB_BFIND_NOT_FOUND_DONT_STORE,
|
hb_bfind_not_found_t not_found = HB_BFIND_NOT_FOUND_DONT_STORE,
|
||||||
|
|
Loading…
Reference in New Issue