[iter] Adjust source_of/sink_of
authorBehdad Esfahbod <behdad@behdad.org>
Sat, 11 May 2019 04:25:07 +0000 (21:25 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Sat, 11 May 2019 04:25:07 +0000 (21:25 -0700)
src/hb-iter.hh

index a0beb2c..194a421 100644 (file)
@@ -277,7 +277,7 @@ struct hb_is_source_of
 {
   private:
   template <typename Iter2 = Iter,
-           hb_enable_if (hb_is_convertible (typename Iter2::item_t, const Item &))>
+           hb_enable_if (hb_is_convertible (typename Iter2::item_t, hb_add_lvalue_reference<hb_add_const<Item>>))>
   static hb_true_type impl (hb_priority<2>);
   template <typename Iter2 = Iter>
   static auto impl (hb_priority<1>) -> decltype (hb_declval (Iter2) >> hb_declval (Item &), hb_true_type ());
@@ -293,7 +293,7 @@ struct hb_is_sink_of
 {
   private:
   template <typename Iter2 = Iter,
-           hb_enable_if (hb_is_convertible (typename Iter2::item_t, Item &))>
+           hb_enable_if (hb_is_convertible (typename Iter2::item_t, hb_add_lvalue_reference<Item>))>
   static hb_true_type impl (hb_priority<2>);
   template <typename Iter2 = Iter>
   static auto impl (hb_priority<1>) -> decltype (hb_declval (Iter2) << hb_declval (Item), hb_true_type ());