summaryrefslogtreecommitdiff
path: root/flower/pcursor.hh
blob: 8b0b179b4fc8035a642e101356c00e195be553f1 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/// cursor which feels like a pointer
template<class T>
struct PCursor : public Cursor<T> {

    /// make cursor with #no# items back
    PCursor<T> operator -( int no) const {
	return PCursor<T> (Cursor<T>::operator-(no));
    }

    /// make cursor with #no# items further
    PCursor<T> operator +( int no) const {
	return PCursor<T> (Cursor<T>::operator+(no));
    }
    PCursor(List<T> & l) : Cursor<T> (l) {}

    PCursor( const Cursor<T>& cursor ) : Cursor<T>(cursor) { }
    T operator ->() { return  *(*this); }

};
/**
 HWN: I'd like an operator->(), so here it is.

 Cursor to go with pointer list.
 */