]> git.donarmstrong.com Git - lilypond.git/commitdiff
flower-1.0.18
authorfred <fred>
Mon, 30 Dec 1996 12:57:54 +0000 (12:57 +0000)
committerfred <fred>
Mon, 30 Dec 1996 12:57:54 +0000 (12:57 +0000)
flower/iterate.hh [new file with mode: 0644]
flower/list.hh
flower/list.inl
flower/plist.hh

diff --git a/flower/iterate.hh b/flower/iterate.hh
new file mode 100644 (file)
index 0000000..adff779
--- /dev/null
@@ -0,0 +1,6 @@
+
+#define iterator(set)          typeof((set).top())
+
+// should use top()
+#define iter_top(set,var)      iterator(set) var(set)
+
index 117e1862e4416720cf5ff5d810d08cc29d718f2a..f49b5d78500d1185a992d54135fe3afbab4633a1 100644 (file)
@@ -16,11 +16,13 @@ class List
     List();    
     virtual ~List();
        
-    Cursor<T> bottom();
-
     int size() const;
-    Cursor<T> top();
-    void OK() const; 
+
+    Cursor<T> bottom() const;  // const sucks..
+    Cursor<T> top() const;
+
+    void OK() const;           // check list
+    
  protected:
     friend class Cursor<T>;
     friend class Link<T>;
index c3ee7e2948263a62bdaeaf81f3e2654b0de39006..df0687b7c8b5b28e71cfd47ad96fbbd64b7caf8e 100644 (file)
@@ -39,7 +39,7 @@ List<T>::size() const
 
 template<class T>
 inline Cursor<T>
-List<T>::top()
+List<T>::top()const
 {
     return Cursor<T>( *this, top_ );
 }
@@ -47,7 +47,7 @@ List<T>::top()
 
 template<class T>
 inline Cursor<T>
-List<T>::bottom()
+List<T>::bottom()const
 {
     return Cursor<T>( *this, bottom_ );
 }
index 99be3ff811a7d673f8c31b2be656261b1aeb1d51..bac9f7bf0227874df00147b76850ab97db1f5d43 100644 (file)
@@ -14,8 +14,12 @@ template<class T>
 class PointerList : public List<void *>
 {
  public:
-    PCursor<T> top() {  return PCursor<T> (List<void*>::top()); }
-    PCursor<T> bottom() { return PCursor<T> (List<void*>::bottom()); }
+    PCursor<T> top() const{
+       return PCursor<T> (List<void*>::top());
+    }
+    PCursor<T> bottom() const {
+       return PCursor<T> (List<void*>::bottom());
+    }
     PCursor<T> find(T) const;
     void concatenate(PointerList<T> const &s) { List<void*>::concatenate(s); }
     PointerList() {}