diff options
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-iter.hh')
-rw-r--r-- | src/3rdparty/harfbuzz-ng/src/hb-iter.hh | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-iter.hh b/src/3rdparty/harfbuzz-ng/src/hb-iter.hh index b57f37b132..61e05180be 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-iter.hh +++ b/src/3rdparty/harfbuzz-ng/src/hb-iter.hh @@ -63,6 +63,7 @@ struct hb_iter_t static constexpr bool is_iterator = true; static constexpr bool is_random_access_iterator = false; static constexpr bool is_sorted_iterator = false; + static constexpr bool has_fast_len = false; // Should be checked in combination with is_random_access_iterator. private: /* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */ @@ -172,10 +173,16 @@ struct HB_FUNCOBJ (hb_iter); struct { - template <typename T> unsigned - operator () (T&& c) const - { return c.len (); } + template <typename T> auto + impl (T&& c, hb_priority<1>) const HB_RETURN (unsigned, c.len ()) + + template <typename T> auto + impl (T&& c, hb_priority<0>) const HB_RETURN (unsigned, c.len) + + public: + template <typename T> auto + operator () (T&& c) const HB_RETURN (unsigned, impl (std::forward<T> (c), hb_prioritize)) } HB_FUNCOBJ (hb_len); @@ -387,7 +394,7 @@ struct hb_map_iter_t : private: Iter it; - hb_reference_wrapper<Proj> f; + mutable hb_reference_wrapper<Proj> f; }; template <typename Proj, hb_function_sortedness_t Sorted> @@ -450,8 +457,8 @@ struct hb_filter_iter_t : private: Iter it; - hb_reference_wrapper<Pred> p; - hb_reference_wrapper<Proj> f; + mutable hb_reference_wrapper<Pred> p; + mutable hb_reference_wrapper<Proj> f; }; template <typename Pred, typename Proj> struct hb_filter_iter_factory_t @@ -835,7 +842,7 @@ struct template <typename Iterable, hb_requires (hb_is_iterable (Iterable))> auto operator () (Iterable&& it, unsigned count) const HB_AUTO_RETURN - ( hb_zip (hb_range (count), it) | hb_map (hb_second) ) + ( hb_zip (hb_range (count), it) | hb_map_retains_sorting (hb_second) ) /* Specialization arrays. */ |