From 9c4085e28cdae2c287fb8d3d5e0ddcc11ebf8594 Mon Sep 17 00:00:00 2001 From: fred Date: Mon, 30 Dec 1996 12:57:54 +0000 Subject: [PATCH] flower-1.0.18 --- flower/iterate.hh | 6 ++++++ flower/list.hh | 10 ++++++---- flower/list.inl | 4 ++-- flower/plist.hh | 8 ++++++-- 4 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 flower/iterate.hh diff --git a/flower/iterate.hh b/flower/iterate.hh new file mode 100644 index 0000000000..adff7792bb --- /dev/null +++ b/flower/iterate.hh @@ -0,0 +1,6 @@ + +#define iterator(set) typeof((set).top()) + +// should use top() +#define iter_top(set,var) iterator(set) var(set) + diff --git a/flower/list.hh b/flower/list.hh index 117e1862e4..f49b5d7850 100644 --- a/flower/list.hh +++ b/flower/list.hh @@ -16,11 +16,13 @@ class List List(); virtual ~List(); - Cursor bottom(); - int size() const; - Cursor top(); - void OK() const; + + Cursor bottom() const; // const sucks.. + Cursor top() const; + + void OK() const; // check list + protected: friend class Cursor; friend class Link; diff --git a/flower/list.inl b/flower/list.inl index c3ee7e2948..df0687b7c8 100644 --- a/flower/list.inl +++ b/flower/list.inl @@ -39,7 +39,7 @@ List::size() const template inline Cursor -List::top() +List::top()const { return Cursor( *this, top_ ); } @@ -47,7 +47,7 @@ List::top() template inline Cursor -List::bottom() +List::bottom()const { return Cursor( *this, bottom_ ); } diff --git a/flower/plist.hh b/flower/plist.hh index 99be3ff811..bac9f7bf02 100644 --- a/flower/plist.hh +++ b/flower/plist.hh @@ -14,8 +14,12 @@ template class PointerList : public List { public: - PCursor top() { return PCursor (List::top()); } - PCursor bottom() { return PCursor (List::bottom()); } + PCursor top() const{ + return PCursor (List::top()); + } + PCursor bottom() const { + return PCursor (List::bottom()); + } PCursor find(T) const; void concatenate(PointerList const &s) { List::concatenate(s); } PointerList() {} -- 2.39.5