From 007856fdfad38061c2a8de9613941b7c9562830a Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 16 Nov 1996 13:22:35 +0000 Subject: [PATCH] flower-1.0.7 --- flower/pcursor.hh | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/flower/pcursor.hh b/flower/pcursor.hh index 095bcc45bf..6cc3433e25 100644 --- a/flower/pcursor.hh +++ b/flower/pcursor.hh @@ -9,28 +9,46 @@ #define PCURSOR_HH -/// cursor which feels like a pointer +/// cursor to go with PointerList template -struct PCursor : public Cursor { +struct PCursor : public Cursor { /// make cursor with #no# items back PCursor operator -( int no) const { - return PCursor (Cursor::operator-(no)); + return PCursor (Cursor::operator-(no)); } /// make cursor with #no# items further PCursor operator +( int no) const { - return PCursor (Cursor::operator+(no)); + return PCursor (Cursor::operator+(no)); } - PCursor(const List & l) : Cursor (l) {} + PCursor(const PointerList & l) : Cursor (l) {} - PCursor( const Cursor& cursor ) : Cursor(cursor) { } - T operator ->() const { return *(*(Cursor *)this); } + PCursor( const Cursor& cursor ) : Cursor(cursor) { } + void* vptr() const { return * ((Cursor &) *this); } + // should return T& ? + T ptr() const { return (T) vptr(); } + T operator ->() const { return ptr(); } + operator T() { return ptr(); } + T operator *() { return ptr(); } + +private: +// Cursor::operator void*; + // sigh }; /** - I like operator->(), so here it is. - - Cursor to go with pointer list. +don't create PointerList's */ + + +template +inline int pcursor_compare(PCursor a,PCursorb) +{ + return cursor_compare(Cursor(b),Cursor (a)); +} + +#include "compare.hh" +template_instantiate_compare(PCursor, pcursor_compare, template); + #endif -- 2.39.5