]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/listdata.h
Add a function to find the index of an item in ListDataStore
[libs/gltk.git] / source / listdata.h
index 38706f8b1cc9ac64648c8b4a0202034b5e1475c3..094b287b703545c294f71a644b33b5be0032af00 100644 (file)
@@ -55,6 +55,14 @@ public:
                return items[i];
        }
 
+       int find(const T &v) const
+       {
+               for(unsigned i=0; i<items.size(); ++i)
+                       if(items[i]==v)
+                               return i;
+               return -1;
+       }
+
        void remove(unsigned i)
        {
                if(i>=items.size())