2 Commits 60f7d0aa65 ... fc74023c4f

Autor SHA1 Mensaje Fecha
  zxs fc74023c4f #json修复 hace 3 semanas
  zxs add61b464c #json修复 hace 3 semanas
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      robot/robotics/json.hpp

+ 4 - 2
robot/robotics/json.hpp

@@ -452,8 +452,9 @@ namespace robotics {
 			template<typename _Ret>
 			static _Ret deserialize(std::string const& value, _Ret& result) {
 				nlohmann::json json = nlohmann::json::parse(value);
-				rttr::variant ret = std::ref(result);
+				rttr::variant ret = result;
 				deserialize(json, ret);
+				result = ret.get_value<_Ret>();
 				return result;
 			}
 			/**
@@ -479,8 +480,9 @@ namespace robotics {
 			static _Ret deserialize(std::string const& value) {
 				_Ret result;
 				nlohmann::json json = nlohmann::json::parse(value);
-				rttr::variant ret = std::ref(result);
+				rttr::variant ret = result;
 				deserialize(json, ret);
+				result = ret.get_value<_Ret>();
 				return result;
 			}
 		};