Refactoring template_parameter model

This commit is contained in:
Bartek Kryza
2023-03-16 01:53:10 +01:00
parent 3a01d8689c
commit 6d4533018b
10 changed files with 393 additions and 254 deletions

View File

@@ -44,15 +44,22 @@ void to_json(nlohmann::json &j, const element &c)
void to_json(nlohmann::json &j, const template_parameter &c)
{
j["type"] = c.type();
j["name"] = c.name();
if (!c.default_value().empty())
j["default_value"] = c.default_value();
j["is_template_parameter"] = c.is_template_parameter();
j["is_template_template_parameter"] = c.is_template_template_parameter();
if (const auto &constraint = c.concept_constraint(); constraint)
j["concept_constraint"] = constraint.value();
j["is_variadic"] = c.is_variadic();
j["kind"] = to_string(c.kind());
if(c.kind() == template_parameter_kind_t::template_type) {
j["name"] = c.name().value();
}
// j["type"] = c.type();
// j["name"] = c.name();
// if (!c.default_value().empty())
// j["default_value"] = c.default_value();
// j["is_template_parameter"] = c.is_template_parameter();
// j["is_template_template_parameter"] = c.is_template_template_parameter();
// if (const auto &constraint = c.concept_constraint(); constraint)
// j["concept_constraint"] = constraint.value();
// j["is_variadic"] = c.is_variadic();
}
void to_json(nlohmann::json &j, const relationship &c)