]> git.donarmstrong.com Git - lilypond.git/blob - flower/pcursor.hh
release: 0.0.4
[lilypond.git] / flower / pcursor.hh
1
2 /*
3   pcursor.hh -- part of flowerlib
4
5   (c) 1996 Han-Wen Nienhuys&Jan Nieuwenhuizen
6 */
7
8 #ifndef PCURSOR_HH
9 #define PCURSOR_HH
10
11
12 /// cursor which feels like a pointer
13 template<class T>
14 struct PCursor : public Cursor<T> {
15
16     /// make cursor with #no# items back
17     PCursor<T> operator -( int no) const {
18         return PCursor<T> (Cursor<T>::operator-(no));
19     }
20
21     /// make cursor with #no# items further
22     PCursor<T> operator +( int no) const {
23         return PCursor<T> (Cursor<T>::operator+(no));
24     }
25     PCursor(const List<T> & l) : Cursor<T> (l) {}
26
27     PCursor( const Cursor<T>& cursor ) : Cursor<T>(cursor) { }
28     T operator ->() { return  *(*this); }
29
30 };
31 /**
32  I like  operator->(), so here it is.
33
34  Cursor to go with pointer list.
35  */
36 #endif