From aa4ac13f0be34bba66b00d04fd7806c474ff59c0 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 8 May 2019 10:02:30 -0700 Subject: [PATCH] [iter] Actually fix previous commit The iter objects shouldn't not be const. D'oh. --- src/hb-iter.hh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hb-iter.hh b/src/hb-iter.hh index dc47389..23d2c27 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -316,7 +316,7 @@ static inline auto end (Iterable&& iterable) HB_AUTO_RETURN (hb_iter (iterable). template static inline auto -operator | (Lhs lhs, const Rhs &rhs) HB_AUTO_RETURN (rhs (lhs)) +operator | (Lhs&& lhs, Rhs&& rhs) HB_AUTO_RETURN (hb_forward (rhs) (hb_forward (lhs))) /* hb_map(), hb_filter(), hb_reduce() */ @@ -355,7 +355,7 @@ struct hb_map_iter_factory_t template hb_map_iter_t - operator () (Iter it) const + operator () (Iter it) { return hb_map_iter_t (it, f); } private: @@ -402,7 +402,7 @@ struct hb_filter_iter_factory_t template hb_filter_iter_t - operator () (Iter it) const + operator () (Iter it) { return hb_filter_iter_t (it, p, f); } private: @@ -428,7 +428,7 @@ struct hb_reduce_t hb_requires (hb_is_iterator (Iter)), typename AccuT = decltype (hb_declval (Redu) (hb_declval (InitT), hb_declval (typename Iter::item_t)))> AccuT - operator () (Iter it) const + operator () (Iter it) { AccuT value = init_value; for (; it; ++it) @@ -549,7 +549,7 @@ struct hb_apply_t template - void operator () (Iter it) const + void operator () (Iter it) { for (; it; ++it) (void) hb_invoke (a, *it); @@ -579,7 +579,7 @@ struct hb_sink_t template - void operator () (Iter it) const + void operator () (Iter it) { for (; it; ++it) s << *it; @@ -619,11 +619,11 @@ HB_FUNCOBJ (hb_drain); template struct hb_unzip_t { - hb_unzip_t (Sink1&& s1, Sink2&& s2) : s1 (s1), s2 (s2) {} + hb_unzip_t (Sink1 s1, Sink2 s2) : s1 (s1), s2 (s2) {} template - void operator () (Iter it) const + void operator () (Iter it) { for (; it; ++it) { -- 2.7.4