[iter] Remove const_iter

This commit is contained in:
Behdad Esfahbod 2018-12-26 19:49:13 -05:00
parent d12b80c05a
commit 6dc4a1c9b1
3 changed files with 9 additions and 13 deletions

View File

@ -47,7 +47,6 @@ template <typename Iter, typename Item = typename Iter::__item_type__>
struct hb_iter_t
{
typedef Iter iter_t;
typedef iter_t const_iter_t;
typedef Item item_t;
enum { item_size = hb_static_size (Item) };
@ -74,7 +73,6 @@ struct hb_iter_t
/* Methods. */
iter_t iter () const { return *thiz(); }
const_iter_t const_iter () const { return iter (); }
item_t& item () const { return thiz()->__item__ (); }
item_t& item_at (unsigned i) const { return thiz()->__item_at__ (i); }
bool more () const { return thiz()->__more__ (); }

View File

@ -671,11 +671,11 @@ struct hb_set_t
/*
* Iterator implementation.
*/
struct const_iter_t :
hb_sorted_iter_t<const_iter_t, const hb_codepoint_t>,
hb_iter_mixin_t<const_iter_t, const hb_codepoint_t>
struct iter_t :
hb_sorted_iter_t<iter_t, const hb_codepoint_t>,
hb_iter_mixin_t<iter_t, const hb_codepoint_t>
{
const_iter_t (const hb_set_t &s_ = Null(hb_set_t)) :
iter_t (const hb_set_t &s_ = Null(hb_set_t)) :
s (&s_), v (INVALID), l (s->get_population () + 1) { __next__ (); }
typedef hb_codepoint_t __item_type__;
@ -690,10 +690,8 @@ struct hb_set_t
hb_codepoint_t v;
unsigned l;
};
const_iter_t const_iter () const { return const_iter_t (*this); }
operator const_iter_t () const { return const_iter (); }
typedef const_iter_t iter_t;
iter_t iter () const { return const_iter (); }
iter_t iter () const { return iter_t (*this); }
operator iter_t () const { return iter (); }
protected:

View File

@ -95,12 +95,12 @@ struct hb_vector_t
{ return hb_array (arrayZ(), length); }
/* Iterator. */
typedef hb_array_t<const Type> const_iter_t;
const_iter_t const_iter () const { return as_array (); }
operator const_iter_t () const { return const_iter (); }
typedef hb_array_t<Type> iter_t;
iter_t iter () { return as_array (); }
operator iter_t () { return iter (); }
typedef hb_array_t<const Type> const_iter_t;
const_iter_t citer () const { return as_array (); }
operator const_iter_t () const { return citer (); }
hb_array_t<const Type> sub_array (unsigned int start_offset, unsigned int count) const
{ return as_array ().sub_array (start_offset, count);}