From 8e77ee83b96b77c9f49caf6e52f000fc4e1a0bdf Mon Sep 17 00:00:00 2001 From: fred Date: Mon, 28 Oct 1996 23:10:51 +0000 Subject: [PATCH] flower-1.0.3 --- flower/cursor.hh | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/flower/cursor.hh b/flower/cursor.hh index 45c02aea15..cff93c68ce 100644 --- a/flower/cursor.hh +++ b/flower/cursor.hh @@ -24,7 +24,7 @@ class Cursor /// make cursor with #no# items further Cursor operator +( int no) const; - + int operator -(Cursor op) const; Cursor operator -=(int); Cursor operator +=(int); @@ -80,13 +80,11 @@ class Cursor /// access the list this came from const List& list() const ; Link* pointer(); - + private: List& list_; Link* pointer_; }; - - /** add and insert extend the list items are always stored as copies in List, but: @@ -98,31 +96,32 @@ private: -/// cursor which feels like a pointer -template -struct PCursor : public Cursor { - /// make cursor with #no# items back - PCursor operator -( int no) const { - return PCursor (Cursor::operator-(no)); - } - /// make cursor with #no# items further - PCursor operator +( int no) const { - return PCursor (Cursor::operator+(no)); - } - PCursor(List & l) : Cursor (l) {} - PCursor( const Cursor& cursor ) : Cursor(cursor) { } - T operator ->() { return *(*this); } +/* + comparations. + */ -}; -/** - HWN: I'd like an operator->(), so here it is. - Cursor to go with pointer list. - */ + + + + + + +#include "compare.hh" + +template +inline int cursor_compare(Cursor a,Cursorb) +{ + return b-a; +} + +template_instantiate_compare(Cursor, cursor_compare, template); + +#include "pcursor.hh" #include "list.hh" #include "cursor.inl" -- 2.39.5