diff options
-rw-r--r-- | discord/json.hpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/discord/json.hpp b/discord/json.hpp index beb1592..0b27d6d 100644 --- a/discord/json.hpp +++ b/discord/json.hpp @@ -12,7 +12,7 @@ struct is_optional<::std::optional<T>> : ::std::true_type {}; template<typename T> inline void json_direct(const ::nlohmann::json &j, const char *key, T &val) { if constexpr (is_optional<T>::value) - val = j.at(key).get<T::value_type>(); + val = j.at(key).get<typename T::value_type>(); else j.at(key).get_to(val); } @@ -21,7 +21,7 @@ template<typename T> inline void json_optional(const ::nlohmann::json &j, const char *key, T &val) { if constexpr (is_optional<T>::value) { if (j.contains(key)) - val = j.at(key).get<T::value_type>(); + val = j.at(key).get<typename T::value_type>(); else val = ::std::nullopt; } else { @@ -35,7 +35,7 @@ inline void json_nullable(const ::nlohmann::json &j, const char *key, T &val) { if constexpr (is_optional<T>::value) { const auto &at = j.at(key); if (!at.is_null()) - val = at.get<T::value_type>(); + val = at.get<typename T::value_type>(); else val = ::std::nullopt; } else { @@ -51,7 +51,7 @@ inline void json_optional_nullable(const ::nlohmann::json &j, const char *key, T if (j.contains(key)) { const auto &at = j.at(key); if (!at.is_null()) - val = at.get<T::value_type>(); + val = at.get<typename T::value_type>(); else val = ::std::nullopt; } else { @@ -72,7 +72,7 @@ inline void json_update_optional_nullable(const ::nlohmann::json &j, const char if (j.contains(key)) { const auto &at = j.at(key); if (!at.is_null()) - val = at.get<T::value_type>(); + val = at.get<typename T::value_type>(); else val = ::std::nullopt; } @@ -95,7 +95,7 @@ inline void json_update_optional_nullable_default(const ::nlohmann::json &j, con if (at.is_null()) val = fallback; else - val = at.get<T::value_type>(); + val = at.get<typename T::value_type>(); } } else { if (j.contains(key)) { |