From Jason Turner

[temp.type]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpysyc0j_6/{from.md → to.md} +16 -10
tmp/tmpysyc0j_6/{from.md → to.md} RENAMED
@@ -6,30 +6,32 @@ Two *template-id*s refer to the same class, function, or variable if
6
  *literal-operator-id*s refer to the same template and
7
  - their corresponding type *template-argument*s are the same type and
8
  - their corresponding non-type template arguments of integral or
9
  enumeration type have identical values and
10
  - their corresponding non-type *template-argument*s of pointer type
11
- refer to the same external object or function or are both the null
12
- pointer value and
13
  - their corresponding non-type *template-argument*s of pointer-to-member
14
  type refer to the same class member or are both the null member
15
  pointer value and
16
  - their corresponding non-type *template-argument*s of reference type
17
- refer to the same external object or function and
18
  - their corresponding template *template-argument*s refer to the same
19
  template.
20
 
 
 
21
  ``` cpp
22
- template<class E, int size> class buffer { /* ... */ };
23
  buffer<char,2*512> x;
24
  buffer<char,1024> y;
25
  ```
26
 
27
  declares `x` and `y` to be of the same type, and
28
 
29
  ``` cpp
30
- template<class T, void(*err_fct)()> class list { /* ... */ };
31
  list<int,&error_handler1> x1;
32
  list<int,&error_handler2> x2;
33
  list<int,&error_handler2> x3;
34
  list<char,&error_handler2> x4;
35
  ```
@@ -45,11 +47,15 @@ X<Y<int> > y;
45
  X<Z<int> > z;
46
  ```
47
 
48
  declares `y` and `z` to be of the same type.
49
 
50
- If an expression e involves a template parameter, `decltype(e)` denotes
51
- a unique dependent type. Two such *decltype-specifier*s refer to the
52
- same type only if their *expression*s are equivalent (
53
- [[temp.over.link]]). however, it may be aliased, e.g., by a
54
- *typedef-name*.
 
 
 
 
55
 
 
6
  *literal-operator-id*s refer to the same template and
7
  - their corresponding type *template-argument*s are the same type and
8
  - their corresponding non-type template arguments of integral or
9
  enumeration type have identical values and
10
  - their corresponding non-type *template-argument*s of pointer type
11
+ refer to the same object or function or are both the null pointer
12
+ value and
13
  - their corresponding non-type *template-argument*s of pointer-to-member
14
  type refer to the same class member or are both the null member
15
  pointer value and
16
  - their corresponding non-type *template-argument*s of reference type
17
+ refer to the same object or function and
18
  - their corresponding template *template-argument*s refer to the same
19
  template.
20
 
21
+ [*Example 1*:
22
+
23
  ``` cpp
24
+ template<class E, int size> class buffer { ... };
25
  buffer<char,2*512> x;
26
  buffer<char,1024> y;
27
  ```
28
 
29
  declares `x` and `y` to be of the same type, and
30
 
31
  ``` cpp
32
+ template<class T, void(*err_fct)()> class list { ... };
33
  list<int,&error_handler1> x1;
34
  list<int,&error_handler2> x2;
35
  list<int,&error_handler2> x3;
36
  list<char,&error_handler2> x4;
37
  ```
 
47
  X<Z<int> > z;
48
  ```
49
 
50
  declares `y` and `z` to be of the same type.
51
 
52
+ *end example*]
53
+
54
+ If an expression e is type-dependent ([[temp.dep.expr]]), `decltype(e)`
55
+ denotes a unique dependent type. Two such *decltype-specifier*s refer to
56
+ the same type only if their *expression*s are equivalent (
57
+ [[temp.over.link]]).
58
+
59
+ [*Note 1*: However, such a type may be aliased, e.g., by a
60
+ *typedef-name*. — *end note*]
61