summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/RT.cpp10
-rw-r--r--lib/RT.hpp17
2 files changed, 15 insertions, 12 deletions
diff --git a/lib/RT.cpp b/lib/RT.cpp
index c76c1d1..741596c 100644
--- a/lib/RT.cpp
+++ b/lib/RT.cpp
@@ -20,24 +20,24 @@ template<> json toJSON<unsigned int>(unsigned int &v) {
20 return json(v); 20 return json(v);
21} 21}
22 22
23template<> String fromJSON<String>(String &v, json &obj) { 23template<> String fromJSON<String>(W<String> v, json &obj) {
24 String s; 24 String s;
25 return s; 25 return s;
26} 26}
27 27
28template<> Float fromJSON<Float>(Float &v, json &obj) { 28template<> Float fromJSON<Float>(W<Float> v, json &obj) {
29 return 0.0; 29 return 0.0;
30} 30}
31 31
32template<> bool fromJSON<bool>(bool &v, json &obj) { 32template<> bool fromJSON<bool>(W<bool> v, json &obj) {
33 return false; 33 return false;
34} 34}
35 35
36template<> int fromJSON<int>(int &v, json &obj) { 36template<> int fromJSON<int>(W<int> v, json &obj) {
37 return 0; 37 return 0;
38} 38}
39 39
40template<> unsigned int fromJSON<unsigned int>(unsigned int &v, json &obj) { 40template<> unsigned int fromJSON<unsigned int>(W<unsigned int> v, json &obj) {
41 return 0; 41 return 0;
42} 42}
43 43
diff --git a/lib/RT.hpp b/lib/RT.hpp
index 569ebf2..d34557e 100644
--- a/lib/RT.hpp
+++ b/lib/RT.hpp
@@ -97,40 +97,43 @@ json toJSON(std::map<k,v> &value) {
97} 97}
98 98
99template<typename T> 99template<typename T>
100T fromJSON(T &v, json &obj); 100struct W {};
101
102template<typename T>
103T fromJSON(W<T> w, json &obj);
101 104
102template<typename any> 105template<typename any>
103Maybe<any> fromJSON(Maybe<any> &v, json &obj) { 106Maybe<any> fromJSON(W<Maybe<any>> v, json &obj) {
104 Maybe<any> a; 107 Maybe<any> a;
105 return a; 108 return a;
106} 109}
107 110
108template<typename any> 111template<typename any>
109V2<any> fromJSON(V2<any> &v, json &obj) { 112V2<any> fromJSON(W<V2<any>> v, json &obj) {
110 V2<any> a; 113 V2<any> a;
111 return a; 114 return a;
112} 115}
113 116
114template<typename any> 117template<typename any>
115V3<any> fromJSON(V3<any> &v, json &obj) { 118V3<any> fromJSON(W<V3<any>> v, json &obj) {
116 V3<any> a; 119 V3<any> a;
117 return a; 120 return a;
118} 121}
119 122
120template<typename any> 123template<typename any>
121V4<any> fromJSON(V4<any> &v, json &obj) { 124V4<any> fromJSON(W<V4<any>> v, json &obj) {
122 V4<any> a; 125 V4<any> a;
123 return a; 126 return a;
124} 127}
125 128
126template<typename any> 129template<typename any>
127std::vector<any> fromJSON(std::vector<any> &v, json &obj) { 130std::vector<any> fromJSON(W<std::vector<any>> v, json &obj) {
128 std::vector<any> a; 131 std::vector<any> a;
129 return a; 132 return a;
130} 133}
131 134
132template<typename k, typename v> 135template<typename k, typename v>
133std::map<k,v> fromJSON(std::map<k,v> &value, json &obj) { 136std::map<k,v> fromJSON(W<std::map<k,v>> value, json &obj) {
134 std::map<k,v> a; 137 std::map<k,v> a;
135 return a; 138 return a;
136} 139}