[Scummvm-cvs-logs] CVS: scummvm/common list.h,1.8,1.9

Max Horn fingolfin at users.sourceforge.net
Sun Oct 5 07:03:08 CEST 2003


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv11486

Modified Files:
	list.h 
Log Message:
added iterators to List template

Index: list.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/list.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- list.h	2 Oct 2003 17:43:01 -0000	1.8
+++ list.h	5 Oct 2003 14:02:28 -0000	1.9
@@ -34,6 +34,10 @@
 	T *_data;
 
 public:
+	typedef T *Iterator;
+	typedef const T *ConstIterator;
+
+public:
 	List<T>() : _capacity(0), _size(0), _data(0) {}
 	List<T>(const List<T>& list) : _capacity(0), _size(0), _data(0) {
 		_size = list._size;
@@ -106,6 +110,23 @@
 	
 	bool isEmpty() const { 
 		return (_size == 0);
+	}
+
+
+	Iterator		begin() {
+		return _data;
+	}
+
+	Iterator		end() {
+		return _data + _size;
+	}
+
+	ConstIterator	begin() const {
+		return _data;
+	}
+
+	ConstIterator	end() const {
+		return _data + _size;
 	}
 
 protected:





More information about the Scummvm-git-logs mailing list