-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
43 lines (35 loc) · 872 Bytes
/
main.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include <scl/utils/toString.h>
#include <scl/macros.h>
#include <scl/concepts/require.h>
#include <sstream>
#include <string>
#include <memory>
namespace std{
template <class T>
inline string to_string(T* ptr){ stringstream ss; ss << ptr; return ss.str(); }
template <class T>
inline string to_string(unique_ptr<T>& uptr){ return to_string(uptr.get()); }
template <class T>
ostream& operator<<(ostream& os, unique_ptr<T>& uptr){
return os << to_string(uptr);
}
}
/*namespace scl{
namespace utils{
template <class T>
struct ToString<T*>{
std::string operator()(realConst(T*) ptr) const{
std::stringstream ss;
ss << ptr;
return ss.str();
}
};
template <>
struct ToString<int>{
std::string operator()(const int& i) const{
return std::to_string(i);
}
};
}
}*/