diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/RT.cpp | 10 | ||||
-rw-r--r-- | lib/RT.hpp | 17 |
2 files changed, 15 insertions, 12 deletions
@@ -20,24 +20,24 @@ template<> json toJSON<unsigned int>(unsigned int &v) { | |||
20 | return json(v); | 20 | return json(v); |
21 | } | 21 | } |
22 | 22 | ||
23 | template<> String fromJSON<String>(String &v, json &obj) { | 23 | template<> String fromJSON<String>(W<String> v, json &obj) { |
24 | String s; | 24 | String s; |
25 | return s; | 25 | return s; |
26 | } | 26 | } |
27 | 27 | ||
28 | template<> Float fromJSON<Float>(Float &v, json &obj) { | 28 | template<> Float fromJSON<Float>(W<Float> v, json &obj) { |
29 | return 0.0; | 29 | return 0.0; |
30 | } | 30 | } |
31 | 31 | ||
32 | template<> bool fromJSON<bool>(bool &v, json &obj) { | 32 | template<> bool fromJSON<bool>(W<bool> v, json &obj) { |
33 | return false; | 33 | return false; |
34 | } | 34 | } |
35 | 35 | ||
36 | template<> int fromJSON<int>(int &v, json &obj) { | 36 | template<> int fromJSON<int>(W<int> v, json &obj) { |
37 | return 0; | 37 | return 0; |
38 | } | 38 | } |
39 | 39 | ||
40 | template<> unsigned int fromJSON<unsigned int>(unsigned int &v, json &obj) { | 40 | template<> unsigned int fromJSON<unsigned int>(W<unsigned int> v, json &obj) { |
41 | return 0; | 41 | return 0; |
42 | } | 42 | } |
43 | 43 | ||
@@ -97,40 +97,43 @@ json toJSON(std::map<k,v> &value) { | |||
97 | } | 97 | } |
98 | 98 | ||
99 | template<typename T> | 99 | template<typename T> |
100 | T fromJSON(T &v, json &obj); | 100 | struct W {}; |
101 | |||
102 | template<typename T> | ||
103 | T fromJSON(W<T> w, json &obj); | ||
101 | 104 | ||
102 | template<typename any> | 105 | template<typename any> |
103 | Maybe<any> fromJSON(Maybe<any> &v, json &obj) { | 106 | Maybe<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 | ||
108 | template<typename any> | 111 | template<typename any> |
109 | V2<any> fromJSON(V2<any> &v, json &obj) { | 112 | V2<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 | ||
114 | template<typename any> | 117 | template<typename any> |
115 | V3<any> fromJSON(V3<any> &v, json &obj) { | 118 | V3<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 | ||
120 | template<typename any> | 123 | template<typename any> |
121 | V4<any> fromJSON(V4<any> &v, json &obj) { | 124 | V4<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 | ||
126 | template<typename any> | 129 | template<typename any> |
127 | std::vector<any> fromJSON(std::vector<any> &v, json &obj) { | 130 | std::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 | ||
132 | template<typename k, typename v> | 135 | template<typename k, typename v> |
133 | std::map<k,v> fromJSON(std::map<k,v> &value, json &obj) { | 136 | std::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 | } |