Commit 432a54e5 authored by Niels's avatar Niels

some type fixes

parent a3f52a5a
...@@ -3800,7 +3800,8 @@ struct hash<nlohmann::json> ...@@ -3800,7 +3800,8 @@ struct hash<nlohmann::json>
inline size_t operator()(const nlohmann::json& j) const inline size_t operator()(const nlohmann::json& j) const
{ {
// a naive hashing via the string representation // a naive hashing via the string representation
return hash<nlohmann::json::string_t>()(j.dump()); const auto& h = hash<nlohmann::json::string_t>();
return h(j.dump());
} }
}; };
} }
...@@ -3815,7 +3816,8 @@ no parse error occurred. ...@@ -3815,7 +3816,8 @@ no parse error occurred.
*/ */
inline nlohmann::json operator "" _json(const char* s, std::size_t) inline nlohmann::json operator "" _json(const char* s, std::size_t)
{ {
return nlohmann::json::parse(s); return nlohmann::json::parse(reinterpret_cast<nlohmann::json::string_t::value_type*>
(const_cast<char*>(s)));
} }
#endif #endif
...@@ -3149,7 +3149,8 @@ struct hash<nlohmann::json> ...@@ -3149,7 +3149,8 @@ struct hash<nlohmann::json>
inline size_t operator()(const nlohmann::json& j) const inline size_t operator()(const nlohmann::json& j) const
{ {
// a naive hashing via the string representation // a naive hashing via the string representation
return hash<nlohmann::json::string_t>()(j.dump()); const auto& h = hash<nlohmann::json::string_t>();
return h(j.dump());
} }
}; };
} }
...@@ -3164,7 +3165,8 @@ no parse error occurred. ...@@ -3164,7 +3165,8 @@ no parse error occurred.
*/ */
inline nlohmann::json operator "" _json(const char* s, std::size_t) inline nlohmann::json operator "" _json(const char* s, std::size_t)
{ {
return nlohmann::json::parse(s); return nlohmann::json::parse(reinterpret_cast<nlohmann::json::string_t::value_type*>
(const_cast<char*>(s)));
} }
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment