NanoStructures  1.0
DMFT solver for layered, strongly correlated nanostructures
utils.h
1 #ifndef UTILS_H
2 #define UTILS_H
3 
4 #include <sstream>
5 
6 namespace utils {
7 std::string timestamp();
8 
9 template <class T>
10 std::string toString (T a) {
11  std::stringstream ss;//create a stringstream
12  ss << a;//add number to the stream
13  return ss.str();//return a string with the contents of the stream
14 }
15 std::string toUpperCase(std::string strToConvert);
16 template <class T>
17 void swap (T& a, T& b) {
18  T c = a;
19  a = b;
20  b = c;
21 }
22 }
23 #endif // UTILS_H