From Jason Turner

[class.gslice.overview]

Diff to HTML by rtfpessoa

tmp/tmpormowl4v/{from.md → to.md} RENAMED
@@ -23,30 +23,36 @@ number to the number of strides, to a single index k. It is useful for
23
  building multidimensional array classes using the `valarray` template,
24
  which is one-dimensional. The set of one-dimensional index values
25
  specified by a `gslice` are $$k = s + \sum_j i_j d_j$$ where the
26
  multidimensional indices iⱼ range in value from 0 to lᵢⱼ - 1.
27
 
 
 
28
  The `gslice` specification
29
 
30
  ``` cpp
31
  start = 3
32
  length = {2, 4, 3}
33
  stride = {19, 4, 1}
34
  ```
35
 
36
  yields the sequence of one-dimensional indices
37
-
38
  $$k = 3 + (0, 1) \times 19 + (0, 1, 2, 3) \times 4 + (0, 1, 2) \times 1$$
39
-
40
  which are ordered as shown in the following table:
41
 
42
  That is, the highest-ordered index turns fastest.
43
 
 
 
44
  It is possible to have degenerate generalized slices in which an address
45
  is repeated.
46
 
 
 
47
  If the stride parameters in the previous example are changed to {1, 1,
48
  1}, the first few elements of the resulting sequence of indices will be
49
 
 
 
50
  If a degenerate slice is used as the argument to the non-`const` version
51
- of `operator[](const gslice&)`, the resulting behavior is undefined.
52
 
 
23
  building multidimensional array classes using the `valarray` template,
24
  which is one-dimensional. The set of one-dimensional index values
25
  specified by a `gslice` are $$k = s + \sum_j i_j d_j$$ where the
26
  multidimensional indices iⱼ range in value from 0 to lᵢⱼ - 1.
27
 
28
+ [*Example 1*:
29
+
30
  The `gslice` specification
31
 
32
  ``` cpp
33
  start = 3
34
  length = {2, 4, 3}
35
  stride = {19, 4, 1}
36
  ```
37
 
38
  yields the sequence of one-dimensional indices
 
39
  $$k = 3 + (0, 1) \times 19 + (0, 1, 2, 3) \times 4 + (0, 1, 2) \times 1$$
 
40
  which are ordered as shown in the following table:
41
 
42
  That is, the highest-ordered index turns fastest.
43
 
44
+ — *end example*]
45
+
46
  It is possible to have degenerate generalized slices in which an address
47
  is repeated.
48
 
49
+ [*Example 2*:
50
+
51
  If the stride parameters in the previous example are changed to {1, 1,
52
  1}, the first few elements of the resulting sequence of indices will be
53
 
54
+ — *end example*]
55
+
56
  If a degenerate slice is used as the argument to the non-`const` version
57
+ of `operator[](const gslice&)`, the behavior is undefined.
58