* Constructors.
*/
hb_array_t () : arrayZ (nullptr), length (0) {}
- hb_array_t (Type *array_, unsigned int length_) : arrayZ (array_), length (length_) {}
template <typename U = Type, hb_enable_if (hb_is_const (U))>
hb_array_t (const hb_array_t<hb_remove_const (Type)> &o) : arrayZ (o.arrayZ), length (o.length) {}
+ hb_array_t (Type *array_, unsigned int length_) : arrayZ (array_), length (length_) {}
template <unsigned int length_> hb_array_t (Type (&array_)[length_]) : arrayZ (array_), length (length_) {}
-
/*
* Iterator implementation.
*/
hb_array (T (&array_)[length_])
{ return hb_array_t<T> (array_); }
-
enum hb_bfind_not_found_t
{
HB_BFIND_NOT_FOUND_DONT_STORE,
/* Returns iterator type of a type. */
#define hb_iter_t(Iterable) decltype (hb_declval (Iterable).iter ())
+
+/* TODO Change to function-object. */
+
template <typename T>
inline hb_iter_t (T)
hb_iter (const T& c) { return c.iter (); }
+/* Specialization for C arrays. */
+template <typename> struct hb_array_t;
+template <typename Type> inline hb_array_t<Type>
+hb_iter (Type *array, unsigned int length) { return hb_array_t<Type> (array, length); }
+template <typename Type, unsigned int length> hb_array_t<Type>
+hb_iter (Type (&array)[length]) { return hb_iter (array, length); }
+
+
/* Mixin to fill in what the subclass doesn't provide. */
template <typename iter_t, typename item_t = typename iter_t::__item_t__>
struct hb_iter_mixin_t
s2 = s;
+ hb_iter (src);
+ hb_iter (src, 2);
+
hb_fill (t, 42);
hb_copy (t, s);
// hb_copy (t, a.iter ());
hb_array_t<hb_vector_t<int> > pa;
pa->as_array ();
- + hb_iter (s)
+ + hb_iter (src)
| hb_map (hb_identity)
| hb_filter ()
| hb_filter (hb_bool)