5 template<class T> class Cursor;
6 template<class T> class Link;
8 /** all-purpose doubly linked list.
10 List can be seen as all items written down on paper,
13 class Cursor is used to extend List
15 items are always stored as copies in List, but:
16 #List<String># : copies of #String# stored
17 #List<String*># : copies of #String*# stored!
18 (do not use, use \Ref{PointerList} #<String*># instead.)
21 retrieving "invalid" cursors, i.e.
22 #top()/bottom()# from empty list, #find()# without success,
23 results in a nonvalid Cursor ( #!ok()# )
35 /// construct empty list
41 Cursor<T> bottom() const; // const sucks.
42 Cursor<T> top() const;
44 void OK() const; // check list
47 friend class Cursor<T>;
50 void concatenate(List<T> const &s);
58 contents lost, and not deleted.
62 void add( T const & thing, Cursor<T> &after_me );
64 /// put thing before #before_me#
65 void insert( T const & thing, Cursor<T> &before_me );
67 /** Remove link pointed to by me. Destructor of contents called
74 WARNING: do not use #me# after calling
76 void remove( Cursor<T> me );
89 // instantiate a template: explicit instantiation.
90 #define L_instantiate(a) template class List<a>; template class Cursor<a>; \
91 template class Link<a>
94 #endif // __LIST_HH //