[otlayout] Add GenericSortedArrayOf

This commit is contained in:
Behdad Esfahbod 2014-05-08 18:21:04 -04:00
parent 0ddecabc6d
commit 40a479797a

View File

@ -949,9 +949,9 @@ struct HeadlessArrayOf
/* An array with sorted elements. Supports binary searching. */ /* An array with sorted elements. Supports binary searching. */
template <typename Type> template <typename LenType, typename Type>
struct SortedArrayOf : ArrayOf<Type> { struct GenericSortedArrayOf : GenericArrayOf<LenType, Type>
{
template <typename SearchType> template <typename SearchType>
inline int search (const SearchType &x) const inline int search (const SearchType &x) const
{ {
@ -972,6 +972,10 @@ struct SortedArrayOf : ArrayOf<Type> {
} }
}; };
/* A sorted array with a USHORT number of elements. */
template <typename Type>
struct SortedArrayOf : GenericSortedArrayOf<USHORT, Type> {};
} /* namespace OT */ } /* namespace OT */