From 5fa52e62b1744347970c42f42bbcd8d2e82d6c60 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 14 Feb 2019 10:51:02 -0800 Subject: [PATCH] [iter] Accept iterator, not iterable, in hb_sink()() --- src/hb-iter.hh | 8 ++++---- src/test-iter.cc | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hb-iter.hh b/src/hb-iter.hh index da11d367f..fe279dd96 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -371,12 +371,12 @@ struct hb_sink_t { hb_sink_t (Sink&& s) : s (s) {} - template + template void - operator () (const Iterable &c) const + operator () (Iter it) const { - for (auto it = c.iter (); it; ++it) + for (; it; ++it) s << *it; } diff --git a/src/test-iter.cc b/src/test-iter.cc index cd94be845..ffd08bb83 100644 --- a/src/test-iter.cc +++ b/src/test-iter.cc @@ -145,6 +145,7 @@ main (int argc, char **argv) | hb_filter () | hb_filter (hb_bool) | hb_filter (hb_bool, hb_identity) + | hb_sink (st) ; t << 1;