aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Json.cpp2
-rw-r--r--lib/Json.h10
-rw-r--r--lib/RemoteControl.cpp2
3 files changed, 3 insertions, 11 deletions
diff --git a/lib/Json.cpp b/lib/Json.cpp
index 9bda8c3..da5b078 100644
--- a/lib/Json.cpp
+++ b/lib/Json.cpp
@@ -67,7 +67,7 @@ namespace json {
ss << "\"" << escape_json(element.first) << "\": ";
- const auto& value = element.second.data;
+ const auto& value = element.second.v;
if (std::holds_alternative<std::string>(value)) {
ss << "\"" << escape_json(std::get<std::string>(value)) << "\"";
}
diff --git a/lib/Json.h b/lib/Json.h
index 26da9a8..ee67f35 100644
--- a/lib/Json.h
+++ b/lib/Json.h
@@ -51,15 +51,7 @@ namespace json {
size_t,
ssize_t,
bool,
- std::nullopt_t> data;
-
- template<class T>
- value_t operator=(const T& map) {
- value_t v;
- v.data = map;
- return v;
- }
-
+ std::nullopt_t> v;
};
std::string map_to_json(const map_t& values);
diff --git a/lib/RemoteControl.cpp b/lib/RemoteControl.cpp
index b544461..fbe0662 100644
--- a/lib/RemoteControl.cpp
+++ b/lib/RemoteControl.cpp
@@ -109,7 +109,7 @@ std::list< std::vector<std::string> > RemoteControllers::get_param_list_values(c
std::string RemoteControllers::get_showjson() {
json::map_t root;
for (auto &controllable : rcs.controllables) {
- root[controllable->get_rc_name()].data = controllable->get_all_values();
+ root[controllable->get_rc_name()].v = controllable->get_all_values();
}
return json::map_to_json(root);