Index: src/Common/VectorMap.h
===================================================================
--- src/Common/VectorMap.h	(revision fa2de9578cda12bc9dfa0f3bc8f2c87a3754e630)
+++ src/Common/VectorMap.h	(revision 97f65d5c634e6bc9c5682e558000e5473fa122cb)
@@ -38,9 +38,9 @@
 	typedef const const_value_type* const_pointer;
 	
-	class iterator : public std::iterator< std::bidirectional_iterator_tag,
+	class iterator : public std::iterator< std::random_access_iterator_tag,
 	                                       value_type,
-										    difference_type,
-											pointer,
-											reference > {
+										   difference_type,
+										   pointer,
+										   reference > {
 	friend class VectorMap;
 	friend class const_iterator;
@@ -74,8 +74,40 @@
 		iterator operator-- (int) { iterator tmp = *this; --(*this); return tmp; }
 
+		iterator& operator+= (difference_type i) {
+			// SHENANIGANS: same reasons as operator++
+			new(&data) value_type{ (data.first + i), *(&data.second + i) };
+			return *this;
+		}
+
+		iterator operator+ (difference_type i) const { iterator tmp = *this; return tmp += i; }
+
+		iterator& operator-= (difference_type i) {
+			// SHENANIGANS: same reasons as operator++
+			new(&data) value_type{ (data.first - i), *(&data.second - i) };
+			return *this;
+		}
+
+		iterator operator- (difference_type i) const { iterator tmp = *this; return tmp -= i; }
+
+		difference_type operator- (const iterator& o) const { return data.first - o.data.first; }
+
+		value_type operator[] (difference_type i) const {
+			// SHENANIGANS: same reasons as operator++
+			return value_type{ (data.first + i), *(&data.second + i) };
+		}
+
 		bool operator== (const iterator& o) const {
 			return data.first == o.data.first && &data.second == &o.data.second;
 		}
+		
 		bool operator!= (const iterator& that) const { return !(*this == that); }
+
+		bool operator< (const iterator& o) const { return data.first < o.data.first; }
+
+		bool operator> (const iterator& o) const { return data.first > o.data.first; }
+
+		bool operator<= (const iterator& o) const { return data.first <= o.data.first; }
+
+		bool operator>= (const iterator& o) const { return data.first >= o.data.first; }
 	};
 
@@ -118,8 +150,46 @@
 		const_iterator operator-- (int) { const_iterator tmp = *this; --(*this); return tmp; }
 
+		const_iterator& operator+= (difference_type i) {
+			// SHENANIGANS: same reasons as iterator::operator++
+			new(&data) const_value_type{ (data.first + i), *(&data.second + i) };
+			return *this;
+		}
+
+		const_iterator operator+ (difference_type i) const {
+			const_iterator tmp = *this; return tmp += i;
+		}
+
+		const_iterator& operator-= (difference_type i) {
+			// SHENANIGANS: same reasons as iterator::operator++
+			new(&data) const_value_type{ (data.first - i), *(&data.second - i) };
+			return *this;
+		}
+
+		const_iterator operator- (difference_type i) const {
+			const_iterator tmp = *this; return tmp -= i;
+		}
+
+		difference_type operator- (const const_iterator& o) const {
+			return data.first - o.data.first;
+		}
+
+		const_value_type operator[] (difference_type i) const {
+			// SHENANIGANS: same reasons as iterator::operator++
+			return const_value_type{ (data.first + i), *(&data.second + i) };
+		}
+
 		bool operator== (const const_iterator& o) const {
 			return data.first == o.data.first && &data.second == &o.data.second;
 		}
+		
 		bool operator!= (const const_iterator& that) const { return !(*this == that); }
+
+		bool operator< (const const_iterator& o) const { return data.first < o.data.first; }
+
+		bool operator> (const const_iterator& o) const { return data.first > o.data.first; }
+
+		bool operator<= (const const_iterator& o) const { return data.first <= o.data.first; }
+
+		bool operator>= (const const_iterator& o) const { return data.first >= o.data.first; }
 	};
 
@@ -163,4 +233,16 @@
 };
 
+template<typename T>
+typename VectorMap<T>::iterator operator+ (typename VectorMap<T>::difference_type i, 
+                                           const typename VectorMap<T>::iterator& it) {
+	return it + i;
+}
+
+template<typename T>
+typename VectorMap<T>::const_iterator operator+ (typename VectorMap<T>::difference_type i, 
+                                                 const typename VectorMap<T>::const_iterator& it) {
+	return it + i;
+}
+
 #endif // _VECTORMAP_H
 
