inc/Operators.h

Go to the documentation of this file.
00001 #ifndef OPERATORS_H_
00002 #define OPERATORS_H_
00003 #include <iostream>
00004 
00005 template <class T> std::pair<T, T> operator+(const std::pair<T, T>& one, const std::pair<T, T>& two) {
00006         std::pair<T, T> r(one.first + two.first, one.second + two.second);
00007         return r;
00008 }
00009 
00010 template <class T> std::pair<T, T> operator-(const std::pair<T, T>& one, const std::pair<T, T>& two) {
00011         std::pair<T, T> r(one.first - two.first, one.second - two.second);
00012         return r;
00013 }
00014 
00015 template <class T> std::ostream& operator<<(std::ostream& s, const std::pair<T, T>& aT) {
00016         s << "(" << aT.first << ", " << aT.second << ")";
00017         return s;
00018 }
00019 
00020 #endif /*OPERATORS_H_*/

Generated on Wed Mar 19 17:47:58 2008 for MapsTracks by  doxygen 1.5.2