diff --git a/src/hb-array.hh b/src/hb-array.hh index fc1bdc854d148db86a24f2c254b097538c320dbf..82b3f1aacd9cc84d86f92c5db6ac60c01e61a0cb 100644 --- a/src/hb-array.hh +++ b/src/hb-array.hh @@ -38,8 +38,9 @@ struct hb_sorted_array_t; template struct hb_array_t : - hb_iter_t, Type&>, - hb_iter_fallback_mixin_t, Type&> + hb_iter_with_mixin_t, + Type&> { /* * Constructors. diff --git a/src/hb-iter.hh b/src/hb-iter.hh index 8052166d6b91806f970fc1feb934ce7665dfc345..c69da3d8f819387ac9cde73ebdf008350930beb7 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -132,6 +132,19 @@ template hb_array_t hb_iter (Type (&array)[length]) { return hb_iter (array, length); } +template class mixin_t, + typename iter_t, + typename item_t = typename iter_t::__item_t__> +struct hb_iter_with_mixin_t : + hb_iter_t, + mixin_t +{ + protected: + hb_iter_with_mixin_t () {} + hb_iter_with_mixin_t (const hb_iter_with_mixin_t &o HB_UNUSED) {} + void operator = (const hb_iter_with_mixin_t &o HB_UNUSED) {} +}; + /* Mixin to fill in what the subclass doesn't provide. */ template struct hb_iter_fallback_mixin_t @@ -270,8 +283,9 @@ hb_map (Proj&& f) template struct hb_filter_iter_t : - hb_iter_t, typename Iter::item_t>, - hb_iter_fallback_mixin_t, typename Iter::item_t> + hb_iter_with_mixin_t, + typename Iter::item_t> { hb_filter_iter_t (const Iter& it_, Pred&& p, Proj&& f) : it (it_), p (p), f (f) { while (it && !p (f (*it))) ++it; } diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 21eb5e8d65426c87d2d831073d4875ecafb80cc2..09232e3608612c0bd6a8838195a89bf190fa2e0a 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -1121,8 +1121,9 @@ struct Coverage } struct iter_t : - hb_iter_t, - hb_iter_fallback_mixin_t + hb_iter_with_mixin_t { static constexpr bool is_sorted_iterator = true; iter_t (const Coverage &c_ = Null(Coverage)) diff --git a/src/hb-set.hh b/src/hb-set.hh index b3e4907d60cee5698d7da609d589c54f67a3a0ae..b1198992df5f9ad16d872036fcf374dd3ddc17c6 100644 --- a/src/hb-set.hh +++ b/src/hb-set.hh @@ -683,8 +683,9 @@ struct hb_set_t * Iterator implementation. */ struct iter_t : - hb_iter_t, - hb_iter_fallback_mixin_t + hb_iter_with_mixin_t { static constexpr bool is_sorted_iterator = true; iter_t (const hb_set_t &s_ = Null(hb_set_t)) : diff --git a/src/test-iter.cc b/src/test-iter.cc index 4da8c9d130370765f264172f669f684e62d61295..83f0bef69d46c3a1ba21dc0c05f497b011475a1d 100644 --- a/src/test-iter.cc +++ b/src/test-iter.cc @@ -34,8 +34,9 @@ template struct array_iter_t : - hb_iter_t, T&>, - hb_iter_fallback_mixin_t, T&> + hb_iter_with_mixin_t, + T&> { array_iter_t (hb_array_t arr_) : arr (arr_) {}