From 0dc0da054d03584a1526ce852d0d3c7839e1d630 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 6 Jul 2022 12:33:37 -0600 Subject: [PATCH] [iter] Add hb_is_sorted_iterator(_of) --- src/hb-iter.hh | 2 ++ src/hb-ot-layout-common.hh | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/hb-iter.hh b/src/hb-iter.hh index d4461f166..1a3ab43de 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -253,6 +253,8 @@ struct hb_is_iterator_of }; #define hb_is_iterator_of(Iter, Item) hb_is_iterator_of::value #define hb_is_iterator(Iter) hb_is_iterator_of (Iter, typename Iter::item_t) +#define hb_is_sorted_iterator_of(Iter, Item) (hb_is_iterator_of::value && Iter::is_sorted_iterator) +#define hb_is_sorted_iterator(Iter) hb_is_sorted_iterator_of (Iter, typename Iter::item_t) /* hb_is_iterable() */ diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 226c3f0d9..c9f41dcfc 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -1926,7 +1926,7 @@ struct ClassDefFormat1 } template + hb_requires (hb_is_sorted_iterator (Iterator))> bool serialize (hb_serialize_context_t *c, Iterator it) { @@ -2138,7 +2138,7 @@ struct ClassDefFormat2 } template + hb_requires (hb_is_sorted_iterator (Iterator))> bool serialize (hb_serialize_context_t *c, Iterator it) { @@ -2411,7 +2411,7 @@ struct ClassDef } template + hb_requires (hb_is_sorted_iterator (Iterator))> bool serialize (hb_serialize_context_t *c, Iterator it_with_class_zero) { TRACE_SERIALIZE (this);