00001 00002 #ifndef TOSTR_H 00003 #define TOSTR_H 00004 #include <sstream> 00005 #include <iostream> 00006 template <class T> std::string toString(const T& aT) { 00007 std::ostringstream oss; 00008 oss << aT; 00009 return oss.str(); 00010 } 00011 00012 template <class T> std::string toString(const std::pair<T, T>& aT) { 00013 std::ostringstream oss; 00014 oss << "(" << aT.first << ", " << aT.second << ")"; 00015 return oss.str(); 00016 } 00017 00018 00019 #endif /*TOSTR_H */ 00020