From Jason Turner

[range.counted]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp6hb0l9m6/{from.md → to.md} +25 -0
tmp/tmp6hb0l9m6/{from.md → to.md} RENAMED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Counted view <a id="range.counted">[[range.counted]]</a>
2
+
3
+ A counted view presents a `view` of the elements of the counted range
4
+ [[iterator.requirements.general]] `i`+\[0, `n`) for an iterator `i` and
5
+ non-negative integer `n`.
6
+
7
+ The name `views::counted` denotes a customization point object
8
+ [[customization.point.object]]. Let `E` and `F` be expressions, let `T`
9
+ be `decay_t<decltype((E))>`, and let `D` be `iter_difference_t<T>`. If
10
+ `decltype((F))` does not model `convertible_to<D>`,
11
+ `views::counted(E, F)` is ill-formed.
12
+
13
+ [*Note 1*: This case can result in substitution failure when
14
+ `views::counted(E, F)` appears in the immediate context of a template
15
+ instantiation. — *end note*]
16
+
17
+ Otherwise, `views::counted(E, F)` is expression-equivalent to:
18
+
19
+ - If `T` models `contiguous_iterator`, then
20
+ `span{to_address(E), static_cast<D>(F)}`.
21
+ - Otherwise, if `T` models `random_access_iterator`, then
22
+ `subrange{E, E + static_cast<D>(F)}`, except that `E` is evaluated
23
+ only once.
24
+ - Otherwise, `subrange{counted_iterator{E, F}, default_sentinel}`.
25
+