1 // cursor.inl -*-c++-*-
9 Cursor<T>::Cursor( const List<T>& list, Link<T>* pointer ) :
10 list_((List<T>&) list )
13 pointer_ = pointer ? pointer : list.top_;
20 Cursor<T>::Cursor( const Cursor<T>& cursor ) :
23 pointer_ = cursor.pointer_;
31 return pointer_->thing();
36 Cursor<T>::operator =( const Cursor<T>& c )
38 assert( &list_ == &c.list_ );
39 pointer_ = c.pointer_;
45 Cursor<T>::add( const T& th )
47 list_.add( th, *this );
52 Cursor<T>::insert( const T& th )
54 list_.insert( th, *this );
59 Cursor<T>::list() const
75 return ( pointer_ != 0 );
82 return ( pointer_ != 0 );
89 return ( pointer_ != 0 );
95 Cursor<T>::operator ++( int )
99 pointer_ = pointer_->next();
105 Cursor<T>::operator --( int )
109 pointer_ = pointer_->previous();