pull/1678/head
Behdad Esfahbod 6 years ago
parent 24da1d0860
commit ae8da4b61b
  1. 9
      src/hb-iter.hh

@ -209,13 +209,16 @@ template <typename T>
struct hb_is_iterable
{
private:
template <typename U>
static auto test (int) -> decltype (hb_declval (U).iter (), hb_true_t ());
static auto impl (hb_priority<1>) -> decltype (hb_declval (U).iter (), hb_true_t ());
template <typename>
static hb_false_t test (...);
static hb_false_t impl (hb_priority<0>);
public:
enum { value = decltype (test<T> (0))::value };
enum { value = decltype (impl<T> (hb_prioritize))::value };
};
#define hb_is_iterable(Iterable) hb_is_iterable<Iterable>::value

Loading…
Cancel
Save