diff options
Diffstat (limited to 'sql/sql_list.h')
-rw-r--r-- | sql/sql_list.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sql/sql_list.h b/sql/sql_list.h index 1711a340cae..505ea994d42 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -155,12 +155,20 @@ protected: class base_list_iterator { +protected: base_list *list; list_node **el,**prev,*current; + void sublist(base_list &ls, uint elm) + { + ls.first= *el; + ls.last= list->last; + ls.elements= elm; + } public: - base_list_iterator(base_list &list_par) :list(&list_par),el(&list_par.first), - prev(0),current(0) + base_list_iterator(base_list &list_par) + :list(&list_par), el(&list_par.first), prev(0), current(0) {} + inline void *next(void) { prev=el; @@ -220,7 +228,6 @@ public: friend class error_list_iterator; }; - template <class T> class List :public base_list { public: @@ -268,6 +275,10 @@ public: List_iterator_fast(List<T> &a) : base_list_iterator(a) {} inline T* operator++(int) { return (T*) base_list_iterator::next_fast(); } inline void rewind(void) { base_list_iterator::rewind(); } + void sublist(List<T> &list, uint el) + { + base_list_iterator::sublist(list, el); + } }; |