324 {
325 if (!j.is_array()) {
326 auto e = nlohmann::json::type_error::create(302, "expected array for glm type", &j);
327 error<std::runtime_error>(
330 std::source_location::current(),
331 "JSON type error: {}", e.what());
332 }
333 constexpr auto n = glm_component_count<T>();
334 if (j.size() != n) {
335 auto e = nlohmann::json::other_error::create(
336 501, "glm component count mismatch", &j);
337 error<std::runtime_error>(
340 std::source_location::current(),
341 "JSON error: expected {} components for type {}, got {}: {}",
342 n,
typeid(
T).name(), j.size(), e.what());
343 }
344 using Comp = glm_component_type<T>;
346 for (size_t i = 0; i < n; ++i) {
347 ptr[i] = j[i].get<Comp>();
348 }
349 }
@ Runtime
General runtime operations (default fallback)
@ IO
Networking, file handling, streaming.