From Jason Turner

[over.sub]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp4er4388x/{from.md → to.md} +10 -9
tmp/tmp4er4388x/{from.md → to.md} RENAMED
@@ -1,21 +1,22 @@
1
  ### Subscripting <a id="over.sub">[[over.sub]]</a>
2
 
3
- `operator[]`
4
-
5
- shall be a non-static member function with exactly one parameter. It
6
- implements the subscripting syntax
7
 
8
  ``` bnf
9
  postfix-expression '[' expr-or-braced-init-list ']'
10
  ```
11
 
12
- Thus, a subscripting expression `x[y]` is interpreted as
13
- `x.operator[](y)` for a class object `x` of type `T` if
14
- `T::operator[](T1)` exists and if the operator is selected as the best
15
- match function by the overload resolution mechanism (
16
- [[over.match.best]]).
 
 
17
 
18
  [*Example 1*:
19
 
20
  ``` cpp
21
  struct X {
 
1
  ### Subscripting <a id="over.sub">[[over.sub]]</a>
2
 
3
+ A *subscripting operator function* is a function named `operator[]` that
4
+ is a non-static member function with exactly one parameter. For an
5
+ expression of the form
 
6
 
7
  ``` bnf
8
  postfix-expression '[' expr-or-braced-init-list ']'
9
  ```
10
 
11
+ the operator function is selected by overload resolution
12
+ [[over.match.oper]]. If a member function is selected, the expression is
13
+ interpreted as
14
+
15
+ ``` bnf
16
+ postfix-expression . operator '['']' '(' expr-or-braced-init-list ')'
17
+ ```
18
 
19
  [*Example 1*:
20
 
21
  ``` cpp
22
  struct X {