Improved handling of method template deductions
This commit is contained in:
@@ -215,6 +215,13 @@ std::string template_parameter::to_string(
|
||||
"{}({})", return_type, fmt::join(function_args, ","));
|
||||
}
|
||||
|
||||
if (is_method_template()) {
|
||||
assert(template_params().size() == 2);
|
||||
|
||||
return fmt::format("{} {}::*{}", template_params().at(0).name().value(),
|
||||
template_params().at(1).name().value(), method_qualifier());
|
||||
}
|
||||
|
||||
std::string res;
|
||||
const auto maybe_type = type();
|
||||
if (maybe_type) {
|
||||
|
||||
@@ -182,6 +182,14 @@ public:
|
||||
|
||||
bool is_function_template() const { return is_function_template_; }
|
||||
|
||||
void set_method_template(bool mt) { is_method_template_ = mt; }
|
||||
|
||||
bool is_method_template() const { return is_method_template_; }
|
||||
|
||||
void set_method_qualifier(const std::string &q) { method_qualifier_ = q; }
|
||||
|
||||
const std::string &method_qualifier() const { return method_qualifier_; }
|
||||
|
||||
private:
|
||||
template_parameter() = default;
|
||||
|
||||
@@ -210,6 +218,10 @@ private:
|
||||
|
||||
bool is_function_template_{false};
|
||||
|
||||
bool is_method_template_{false};
|
||||
|
||||
std::string method_qualifier_;
|
||||
|
||||
/// Stores optional fully qualified name of constraint for this template
|
||||
/// parameter
|
||||
std::optional<std::string> concept_constraint_;
|
||||
|
||||
Reference in New Issue
Block a user