[iter] Fix hb_sink() to accept rvalue
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 8 May 2019 16:48:55 +0000 (09:48 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 8 May 2019 16:48:55 +0000 (09:48 -0700)
src/hb-iter.hh
src/test-iter.cc

index aa5eb9c..a339013 100644 (file)
@@ -569,7 +569,7 @@ HB_FUNCOBJ (hb_apply);
 template <typename Sink>
 struct hb_sink_t
 {
-  hb_sink_t (Sink&& s) : s (s) {}
+  hb_sink_t (Sink s) : s (s) {}
 
   template <typename Iter,
            hb_requires (hb_is_iterator (Iter))>
index 17a1972..fe3c8f3 100644 (file)
@@ -186,6 +186,10 @@ main (int argc, char **argv)
   ;
 
   + hb_iter (src)
+  | hb_sink (hb_array (dst))
+  ;
+
+  + hb_iter (src)
   | hb_apply (&st)
   ;