1 // cursor.inl -*-c++-*-
9 Cursor<T>::Cursor( List<T>& list, Link<T>* pointer ) :
13 pointer_ = pointer ? pointer : list.top_;
14 //list.top().pointer_; // ARGH! recursion.
21 Cursor<T>::Cursor( const Cursor<T>& cursor ) :
24 pointer_ = cursor.pointer_;
29 Cursor<T>::operator *()
32 return pointer_->thing();
37 Cursor<T>::operator =( const Cursor<T>& c )
39 assert( &list_ == &c.list_ );
40 pointer_ = c.pointer_;
46 Cursor<T>::add( const T& thing )
48 list_.add( thing, *this );
53 Cursor<T>::insert( const T& thing )
55 list_.insert( thing, *this );
60 Cursor<T>::backspace()
64 list_.remove( *this );
73 list_.remove( *this );
79 Cursor<T>::list() const
95 return ( pointer_ != 0 );
102 return ( pointer_ != 0 );
109 return ( pointer_ != 0 );