File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ testml-run-file() {
2222 $lib /runtime.cpp \
2323 $lib /stdlib.cpp \
2424 $lib /bridge.cpp \
25+ $lib /wrapper.cpp \
2526 $bridge_file || return
2627
2728 chmod +x $testml_runner
Original file line number Diff line number Diff line change 1+ #include " wrapper.hpp"
2+
3+ namespace testml {
4+ namespace wrapper {
5+
6+ using json = nlohmann::json;
7+
8+ template <>
9+ nlohmann::json cook (std::string s) {
10+ return nlohmann::json::string_t {s};
11+ }
12+
13+ template <>
14+ nlohmann::json cook (int i) {
15+ return nlohmann::json::number_integer_t {i};
16+ }
17+
18+ template <>
19+ std::string uncook (nlohmann::json s) {
20+ return s;
21+ }
22+
23+ template <>
24+ int uncook (nlohmann::json i) {
25+ return i;
26+ }
27+
28+ }
29+ }
Original file line number Diff line number Diff line change 1+ #pragma once
2+
3+ #include " ../../ext/nlohmann/json.hpp"
4+
5+ namespace testml {
6+ namespace wrapper {
7+
8+ template <typename T>
9+ nlohmann::json cook (T);
10+
11+ template <typename T>
12+ T uncook (nlohmann::json);
13+
14+
15+ }
16+ }
You can’t perform that action at this time.
0 commit comments