提交 68d4a5ee 编写于 作者: B Behdad Esfahbod

[array] Add constructor from fixed-size array

上级 a4354d2f
......@@ -46,6 +46,7 @@ struct hb_array_t
hb_array_t (const hb_array_t &o) : arrayZ (o.arrayZ), len (o.len) {}
hb_array_t (hb_array_t<const Type> o) : arrayZ (o.arrayZ), len (o.len) {}
hb_array_t (Type *array_, unsigned int len_) : arrayZ (array_), len (len_) {}
template <unsigned int len_> hb_array_t (Type (&array_)[len_]) : arrayZ (array_), len (len_) {}
/*
* Operators.
......
......@@ -54,7 +54,7 @@ struct Iter;
template <typename T>
struct Iter
{
explicit inline Iter (const T &c);
Iter (const T &c);
};
#endif
......@@ -68,7 +68,7 @@ struct Iter<T *>
Iter (T *array_, int length_) :
array (array_), length (MAX (length_, 0)) {}
template <unsigned int length_>
explicit inline Iter (T (&array_)[length_]) :
Iter (T (&array_)[length_]) :
array (array_), length (length_) {}
/* Emptiness. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册