#pragma once #include #include namespace floormat { struct json_helper final { using json = nlohmann::json; template static T from_json(StringView pathname) noexcept(false); template static void to_json(const T& self, StringView pathname) noexcept(false); static json from_json_(StringView pathname) noexcept(false); static void to_json_(const json& j, StringView pathname) noexcept(false); }; template T json_helper::from_json(StringView pathname) noexcept(false) { return from_json_(pathname); } template void json_helper::to_json(const T& self, StringView pathname) noexcept(false) { to_json_(json(self), pathname); } } // namespace floormat