[iter] Adjust is_source_of / is_sink_of

There are two cases that we accept.  Encode both.
This commit is contained in:
Behdad Esfahbod 2019-05-10 11:18:52 -07:00
parent 1b58bf22ca
commit 98974ac16f
1 changed files with 7 additions and 1 deletions

View File

@ -279,6 +279,8 @@ struct hb_is_source_of
template <typename Iter2 = Iter, 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, const Item &))>
static hb_true_t impl (hb_priority<2>); static hb_true_t impl (hb_priority<2>);
template <typename Iter2 = Iter>
static auto impl (hb_priority<1>) -> decltype (hb_declval (Iter2) >> hb_declval (Item &), hb_true_t ());
static hb_false_t impl (hb_priority<0>); static hb_false_t impl (hb_priority<0>);
public: public:
@ -290,7 +292,11 @@ template<typename Iter, typename Item>
struct hb_is_sink_of struct hb_is_sink_of
{ {
private: private:
static auto impl (hb_priority<2>) -> decltype (hb_declval (Iter) << hb_declval (Item), hb_true_t ()); template <typename Iter2 = Iter,
hb_enable_if (hb_is_convertible (typename Iter2::item_t, Item &))>
static hb_true_t impl (hb_priority<2>);
template <typename Iter2 = Iter>
static auto impl (hb_priority<1>) -> decltype (hb_declval (Iter2) << hb_declval (Item), hb_true_t ());
static hb_false_t impl (hb_priority<0>); static hb_false_t impl (hb_priority<0>);
public: public: