#define hb_is_iterable(Iterable) hb_is_iterable<Iterable>::value
-/* hb_is_iterator() / hb_is_sorted_iterator() */
+/* hb_is_iterator() / hb_is_random_access_iterator() / hb_is_sorted_iterator() */
template <typename Iter>
struct _hb_is_iterator_of
#define hb_is_iterator_of(Iter, Item) hb_is_iterator_of<Iter, Item>::value
#define hb_is_iterator(Iter) hb_is_iterator_of (Iter, typename Iter::item_t)
+#define hb_is_random_access_iterator_of(Iter, Item) \
+ hb_is_iterator_of (Iter, Item) && Iter::is_random_access_iterator
+#define hb_is_random_access_iterator(Iter) \
+ hb_is_random_access_iterator_of (Iter, typename Iter::item_t)
+
#define hb_is_sorted_iterator_of(Iter, Item) \
- hb_is_iterator_of (Iter, Item) && \
- Iter::is_sorted_iterator
+ hb_is_iterator_of (Iter, Item) && Iter::is_sorted_iterator
#define hb_is_sorted_iterator(Iter) \
hb_is_sorted_iterator_of (Iter, typename Iter::item_t)
array_iter_t<const int> s2 (v); /* Implicit conversion from vector. */
array_iter_t<int> t (dst);
+ assert (hb_is_random_access_iterator (array_iter_t<int>));
+
some_array_t<const int> a (src);
s2 = s;