src/types.h

changeset 293
a0ed563e14b2
parent 290
be0c367e7420
child 297
2cbd8ac8293b
--- a/src/types.h	Sat Jun 15 19:14:42 2013 +0300
+++ b/src/types.h	Sun Jun 16 00:10:11 2013 +0300
@@ -52,6 +52,7 @@
 typedef uint64_t uint64;
 
 template<class T> using initlist = std::initializer_list<T>;
+template<class T, class R> using pair = std::pair<T, R>;
 using std::size_t;
 
 enum Axis { X, Y, Z };
@@ -187,8 +188,9 @@
 		m_vect.erase (m_vect.begin () + pos);
 	}
 	
-	void push_back (const T& value) {
+	T& push_back (const T& value) {
 		m_vect.push_back (value);
+		return m_vect[m_vect.size () - 1];
 	}
 	
 	void push_back (const vector<T>& vals) {
@@ -205,14 +207,12 @@
 		return true;
 	}
 	
-	vector<T>& operator<< (const T& value) {
-		push_back (value);
-		return *this;
+	T& operator<< (const T& value) {
+		return push_back (value);
 	}
 	
-	vector<T>& operator<< (const vector<T>& vals) {
+	void operator<< (const vector<T>& vals) {
 		push_back (vals);
-		return *this;
 	}
 	
 	bool operator>> (T& value) {

mercurial