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 parameters duplicated if template is forward-declared #105

Open
cbiffle opened this issue Jul 13, 2015 · 1 comment
Open

Template parameters duplicated if template is forward-declared #105

cbiffle opened this issue Jul 13, 2015 · 1 comment

Comments

@cbiffle
Copy link

cbiffle commented Jul 13, 2015

Documentation lists template parameters twice if a template is forward-declared.

Found at commit b3fc442

Example input

template <typename X>
struct Unit;

template <typename X>
struct Unit {
  T contents;
};

Output

screenshot showing duplicated parameters

Notes

It doesn't matter if the forward declaration appears before or after the definition. That is, this produces the same output:

template <typename X>
struct Unit {
  T contents;
};

template <typename X>
struct Unit;
@cbiffle
Copy link
Author

cbiffle commented Jul 13, 2015

It may be worth noting that, if the template parameters have different names at each site, they are accumulated in the order they appear. e.g.

template <typename X>
struct Unit;

template <typename T>
struct Unit {};

is documented as Unit<X, T>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant