From Jason Turner

[temp.mem]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpovqakl30/{from.md → to.md} +10 -10
tmp/tmpovqakl30/{from.md → to.md} RENAMED
@@ -16,27 +16,27 @@ template<class T> struct string {
16
 
17
  template<class T> template<class T2> int string<T>::compare(const T2& s) {
18
  }
19
  ```
20
 
21
- A local class shall not have member templates. Access control rules
22
- (Clause  [[class.access]]) apply to member template names. A destructor
23
- shall not be a member template. A normal (non-template) member function
24
- with a given name and type and a member function template of the same
25
- name, which could be used to generate a specialization of the same type,
26
- can both be declared in a class. When both exist, a use of that name and
27
- type refers to the non-template member unless an explicit template
28
- argument list is supplied.
29
 
30
  ``` cpp
31
  template <class T> struct A {
32
  void f(int);
33
  template <class T2> void f(T2);
34
  };
35
 
36
- template <> void A<int>::f(int) { } // non-template member
37
- template <> template <> void A<int>::f<>(int) { } // template member
38
 
39
  int main() {
40
  A<char> ac;
41
  ac.f(1); // non-template
42
  ac.f('c'); // template
 
16
 
17
  template<class T> template<class T2> int string<T>::compare(const T2& s) {
18
  }
19
  ```
20
 
21
+ A local class of non-closure type shall not have member templates.
22
+ Access control rules (Clause  [[class.access]]) apply to member template
23
+ names. A destructor shall not be a member template. A non-template
24
+ member function ([[dcl.fct]]) with a given name and type and a member
25
+ function template of the same name, which could be used to generate a
26
+ specialization of the same type, can both be declared in a class. When
27
+ both exist, a use of that name and type refers to the non-template
28
+ member unless an explicit template argument list is supplied.
29
 
30
  ``` cpp
31
  template <class T> struct A {
32
  void f(int);
33
  template <class T2> void f(T2);
34
  };
35
 
36
+ template <> void A<int>::f(int) { } // non-template member function
37
+ template <> template <> void A<int>::f<>(int) { } // member function template specialization
38
 
39
  int main() {
40
  A<char> ac;
41
  ac.f(1); // non-template
42
  ac.f('c'); // template