json_utils: try_parse_value for unit<T>

This commit is contained in:
2019-08-24 19:19:57 +07:00
parent 5b68c7430c
commit 1ab974455b

View File

@@ -113,6 +113,13 @@ namespace e2d::json_utils
v = math::numeric_cast<T>(root.GetFloat());
return true;
}
template < typename T, typename Tag >
std::enable_if_t<
std::is_arithmetic_v<T>, bool>
try_parse_value(const rapidjson::Value& root, unit<T, Tag>& v) noexcept {
return try_parse_value(root, v.value);
}
}
namespace e2d::json_utils