mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-06 20:15:19 +03:00
fix compile
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user