Added constrained template parameter names in requires relationship

This commit is contained in:
Bartek Kryza
2023-02-25 19:35:18 +01:00
parent 274a698713
commit 1fc0bf3f80
7 changed files with 139 additions and 43 deletions

View File

@@ -147,4 +147,16 @@ std::vector<common::model::template_parameter> parse_unexposed_template_params(
const std::string &params,
const std::function<std::string(const std::string &)> &ns_resolve,
int depth = 0);
template <typename T, typename P, typename F>
void if_dyn_cast(P pointer, F &&func)
{
if (pointer == nullptr)
return;
if (const auto *dyn_cast_value = clang::dyn_cast<T>(pointer);
dyn_cast_value) {
std::forward<F>(func)(dyn_cast_value);
}
}
} // namespace clanguml::common