Workaround for vector_shared_ptr_templated serialization mess.

This commit is contained in:
Sebastian
2024-12-19 01:00:38 +01:00
parent 9b75b36c41
commit c3543cffce
3 changed files with 15 additions and 29 deletions
+7 -26
View File
@@ -35,31 +35,11 @@ namespace nlohmann {
}
}
};
/**/
/*template <typename T>*/
/*struct adl_serializer<std::shared_ptr<NODES::NodeHandle<T>>> {*/
/* template< typename J> */
/* static void to_json(J& j, const std::shared_ptr<NODES::NodeHandle<T>>& opt) {*/
/* if (opt) {*/
/* j = *opt;*/
/* } else {*/
/* j = nullptr;*/
/* }*/
/* }*/
/* template< typename J>*/
/* static void from_json(const J& j, std::shared_ptr<NODES::NodeHandle<T>>& opt) {*/
/* if (j.is_null()) {*/
/* opt = nullptr;*/
/* } else {*/
/* opt.reset(new NODES::NodeHandle<T>(j.template get<NODES::NodeHandle<T>>()));*/
/* }*/
/* }*/
/*};*/
/*template <template<typename> class S, typename T>*/
/*struct adl_serializer<std::shared_ptr<S<T>>> {*/
/* static void to_json(json& j, const std::shared_ptr<S<T>>& opt) {*/
/*struct adl_serializer<std::shared_ptr<T>> {*/
/* template <typename J>*/
/* static void to_json(J& j, const std::shared_ptr<T>& opt) {*/
/* if (opt) {*/
/* j = *opt;*/
/* } else {*/
@@ -67,11 +47,12 @@ namespace nlohmann {
/* }*/
/* }*/
/**/
/* static void from_json(const json& j, std::shared_ptr<S<T>>& opt) {*/
/* template <typename J>*/
/* static void from_json(const J& j, std::shared_ptr<T>& opt) {*/
/* if (j.is_null()) {*/
/* opt = nullptr;*/
/* } else {*/
/* opt.reset(new S<T>(j.get<S<T>>()));*/
/* opt.reset(new T(j.template get<T>()));*/
/* }*/
/* }*/
/*};*/