3 pcursor.hh -- part of flowerlib
5 (c) 1996 Han-Wen Nienhuys&Jan Nieuwenhuizen
12 /// cursor to go with PointerList
14 struct PCursor : public Cursor<void *> {
16 /// make cursor with #no# items back
17 PCursor<T> operator -( int no) const {
18 return PCursor<T> (Cursor<void*>::operator-(no));
21 /// make cursor with #no# items further
22 PCursor<T> operator +( int no) const {
23 return PCursor<T> (Cursor<void*>::operator+(no));
25 PCursor(const PointerList<T> & l) : Cursor<void*> (l) {}
27 PCursor( const Cursor<void*>& cursor ) : Cursor<void*>(cursor) { }
28 void* vptr() const { return * ((Cursor<void*> &) *this); }
31 T ptr() const { return (T) vptr(); }
32 T operator ->() const { return ptr(); }
33 operator T() { return ptr(); }
34 T operator *() { return ptr(); }
37 // Cursor<void*>::operator void*;
41 don't create PointerList<void*>'s
46 inline int pcursor_compare(PCursor<T> a,PCursor<T>b)
48 return cursor_compare(Cursor<void*>(b),Cursor<void*> (a));
52 template_instantiate_compare(PCursor<T>, pcursor_compare, template<class T>);