From Jason Turner

[valarray.access]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmprl2wogfq/{from.md → to.md} +11 -10
tmp/tmprl2wogfq/{from.md → to.md} RENAMED
@@ -1,34 +1,35 @@
1
- #### `valarray` element access <a id="valarray.access">[[valarray.access]]</a>
2
 
3
  ``` cpp
4
  const T& operator[](size_t n) const;
5
  T& operator[](size_t n);
6
  ```
7
 
8
- *Requires:* `n < size()`.
9
 
10
  *Returns:* A reference to the corresponding element of the array.
11
 
12
  [*Note 1*: The expression `(a[i] = q, a[i]) == q` evaluates to `true`
13
  for any non-constant `valarray<T> a`, any `T q`, and for any `size_t i`
14
  such that the value of `i` is less than the length of
15
  `a`. — *end note*]
16
 
17
- *Remarks:* The expression `&a[i+j] == &a[i] + j` evaluates to `true` for
18
- all `size_t i` and `size_t j` such that `i+j < a.size()`.
 
19
 
20
- The expression `&a[i] != &b[j]` evaluates to `true` for any two arrays
21
- `a` and `b` and for any `size_t i` and `size_t j` such that
22
- `i < a.size()` and `j < b.size()`.
23
 
24
  [*Note 2*: This property indicates an absence of aliasing and may be
25
  used to advantage by optimizing compilers. Compilers may take advantage
26
  of inlining, constant propagation, loop fusion, tracking of pointers
27
  obtained from `operator new`, and other techniques to generate efficient
28
  `valarray`s. — *end note*]
29
 
30
  The reference returned by the subscript operator for an array shall be
31
- valid until the member function
32
- `resize(size_t, T)` ([[valarray.members]]) is called for that array or
33
- until the lifetime of that array ends, whichever happens first.
34
 
 
1
+ #### Element access <a id="valarray.access">[[valarray.access]]</a>
2
 
3
  ``` cpp
4
  const T& operator[](size_t n) const;
5
  T& operator[](size_t n);
6
  ```
7
 
8
+ *Preconditions:* `n < size()` is `true`.
9
 
10
  *Returns:* A reference to the corresponding element of the array.
11
 
12
  [*Note 1*: The expression `(a[i] = q, a[i]) == q` evaluates to `true`
13
  for any non-constant `valarray<T> a`, any `T q`, and for any `size_t i`
14
  such that the value of `i` is less than the length of
15
  `a`. — *end note*]
16
 
17
+ *Remarks:* The expression `addressof(a[i+j]) == addressof(a[i]) + j`
18
+ evaluates to `true` for all `size_t i` and `size_t j` such that
19
+ `i+j < a.size()`.
20
 
21
+ The expression `addressof(a[i]) != addressof(b[j])` evaluates to `true`
22
+ for any two arrays `a` and `b` and for any `size_t i` and `size_t j`
23
+ such that `i < a.size()` and `j < b.size()`.
24
 
25
  [*Note 2*: This property indicates an absence of aliasing and may be
26
  used to advantage by optimizing compilers. Compilers may take advantage
27
  of inlining, constant propagation, loop fusion, tracking of pointers
28
  obtained from `operator new`, and other techniques to generate efficient
29
  `valarray`s. — *end note*]
30
 
31
  The reference returned by the subscript operator for an array shall be
32
+ valid until the member function `resize(size_t, T)` [[valarray.members]]
33
+ is called for that array or until the lifetime of that array ends,
34
+ whichever happens first.
35