29 std::vector<std::string> cv_qualifiers;
31 cv_qualifiers.emplace_back(
"const");
33 cv_qualifiers.emplace_back(
"volatile");
35 auto res = fmt::format(
"{}", fmt::join(cv_qualifiers,
" "));
65 return "template_type";
67 return "template_template_type";
69 return "non_type_template";
73 return "concept_constraint";
81 const std::string &name,
const std::optional<std::string> &default_value,
95 const std::string &name,
const std::optional<std::string> &default_value,
108 const std::string &type,
const std::optional<std::string> &name,
109 const std::optional<std::string> &default_value,
bool is_variadic)
123 const std::string &type,
const std::optional<std::string> &default_value)
134 const std::string &type,
const std::optional<std::string> &default_value)
174 return type_.value() +
"...";
205 return name_.value() +
"...";
224 is_variadic_ = is_variadic;
259 auto maybe_base_template_parameter_type = base_template_parameter.
type();
260 auto maybe_template_parameter_type =
type();
262 if (maybe_base_template_parameter_type.has_value() &&
263 maybe_template_parameter_type.has_value() &&
266 if (maybe_base_template_parameter_type.value() !=
267 maybe_template_parameter_type.value())
292 if (params_match == 0)
312 res +=
static_cast<int>(
329const std::vector<template_parameter> &
337 std::vector<std::string> deduced_contexts;
340 deduced_contexts.push_back(c.to_string());
343 return fmt::format(
"{}", fmt::join(deduced_contexts,
" "));
348 bool skip_qualifiers)
const
359 auto element_type = it->to_string(using_namespace, relative);
362 std::vector<std::string> dimension_args;
364 dimension_args.push_back(it->to_string(using_namespace, relative));
367 "{}[{}]", element_type, fmt::join(dimension_args,
"]["));
372 auto return_type = it->to_string(using_namespace, relative);
375 std::vector<std::string> function_args;
377 function_args.push_back(it->to_string(using_namespace, relative));
380 "{}({})", return_type, fmt::join(function_args,
","));
386 std::string unqualified = fmt::format(
"{} {}::*",
400 auto return_type = it->to_string(using_namespace, relative);
402 auto class_type = it->to_string(using_namespace, relative);
404 std::vector<std::string> args;
407 args.push_back(it->to_string(using_namespace, relative));
410 std::string unqualified = fmt::format(
411 "{} ({}::*)({})", return_type, class_type, fmt::join(args,
","));
419 const auto maybe_type =
type();
431 if (maybe_concept_constraint) {
435 res +=
namespace_{maybe_concept_constraint.value()}
440 const auto maybe_name =
name();
443 if ((maybe_type && !maybe_type.value().empty()) ||
444 maybe_concept_constraint)
457 std::vector<std::string> params;
461 template_param.to_string(using_namespace, relative));
464 res += fmt::format(
"<{}>", fmt::join(params,
","));
467 if (!skip_qualifiers)
471 if (maybe_default_value) {
473 res += maybe_default_value.value();
480 std::vector<std::pair<eid_t, common::model::relationship_t>>
481 &nested_relationships,
483 const std::function<
bool(
const std::string &full_name)> &should_include)
486 bool added_aggregation_relationship{
false};
490 const auto maybe_type =
type();
495 if (maybe_type && should_include(maybe_type.value())) {
499 const auto maybe_id =
id();
501 nested_relationships.emplace_back(maybe_id.value(), hint);
502 added_aggregation_relationship =
511 const auto maybe_id = template_argument.id();
512 const auto maybe_arg_type = template_argument.type();
514 if (maybe_id && maybe_arg_type && should_include(*maybe_arg_type)) {
516 if (template_argument.is_association() &&
520 nested_relationships.emplace_back(maybe_id.value(), hint);
522 added_aggregation_relationship =
526 if (template_argument.is_function_template())
529 added_aggregation_relationship =
530 template_argument.find_nested_relationships(
531 nested_relationships, hint, should_include);
536 return added_aggregation_relationship;
555 bool is_template_template_parameter)
634 const std::vector<template_parameter> &specialization_params,
635 const std::vector<template_parameter> &template_params)
639 if (specialization_params.size() != template_params.size() &&
640 !std::any_of(template_params.begin(), template_params.end(),
641 [](
const auto &t) { return t.is_variadic(); })) {
645 if (!specialization_params.empty() && !template_params.empty()) {
646 auto template_index{0U};
649 while (arg_index < specialization_params.size() &&
650 template_index < template_params.size()) {
651 auto match = specialization_params.at(arg_index)
652 .calculate_specialization_match(
653 template_params.at(template_index));
662 if (!specialization_params.at(arg_index).is_template_parameter())
667 if (!template_params.at(template_index).is_template_parameter())
670 if (!template_params.at(template_index).is_variadic())
678 if (arg_index == specialization_params.size()) {
681 template_index = template_params.size() - 1;
682 arg_index = specialization_params.size() - 1;
685 auto match = specialization_params.at(arg_index)
686 .calculate_specialization_match(
687 template_params.at(template_index));
692 if (arg_index == 0 || template_index == 0)
697 if (!template_params.at(template_index).is_variadic())