Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

template arguments for templated methods don't appear in cppinsights #254

Closed
pseyfert opened this issue Oct 15, 2019 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@pseyfert
Copy link

demonstrator

When dealing with a templated method of a struct, it appears that the template arguments of templated methods do not appear in the output of cppinsights:

struct demonstrator{
  template <typename return_type = double>
  return_type templated_function() {
    return return_type{};
  }
};

int demonstrate() {
  demonstrator D;
  D.template templated_function<bool>();
  D.template templated_function<float>();
  D.template templated_function();
  return 42;
}

here all three templated_function calls appear just as templated_function() in the output.
Prefered would be printing the template parameters, including the default parameters

  D.template templated_function<bool>();
  D.template templated_function<float>();
  D.template templated_function<double>();

(background, I was dealing with a range based for loop where begin and end
of the looped struct have template parameters. So while this looks unimportant
in the MWE it can be that the template parameters appear neither directly in
the user's source, nor the cppinsights output)

@andreasfertig
Copy link
Owner

Hello @pseyfert,

thanks for bringing that up. That indeed is an interesting case. I'll have a look into it and come back to you.

Andreas

@andreasfertig andreasfertig added the enhancement New feature or request label Oct 16, 2019
andreasfertig added a commit that referenced this issue Nov 12, 2019
Fixed #254: Show `MemberExpr` template parameters as comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants