00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef SELDON_FILE_COMMON_HXX
00021
00022 class Spacetown
00023 {
00024 };
00025
00026 template <class T>
00027 void PrintArray(T* v, int lgth)
00028 {
00029 for (int k = 0; k < lgth - 1; k++)
00030 std::cout << v[k] << " | ";
00031 std::cout << v[lgth - 1] << std::endl;
00032 }
00033
00034 namespace Seldon
00035 {
00036
00037
00039
00043 template<typename T>
00044 std::string to_str(const T& input)
00045 {
00046 std::ostringstream output;
00047 output << input;
00048 return output.str();
00049 }
00050
00052
00056 template <class T>
00057 void to_num(std::string s, T& num)
00058 {
00059 std::istringstream str(s);
00060 str >> num;
00061 }
00062
00064
00068 template <class T>
00069 T to_num(std::string s)
00070 {
00071 T num;
00072 std::istringstream str(s);
00073 str >> num;
00074 return num;
00075 }
00076
00077
00078 }
00079
00080 #define SELDON_FILE_COMMON_HXX
00081 #endif