Workaround for vector_shared_ptr_templated serialization mess.
This commit is contained in:
+7
-26
@@ -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>()));*/
|
||||
/* }*/
|
||||
/* }*/
|
||||
/*};*/
|
||||
|
||||
Reference in New Issue
Block a user