From Jason Turner

[range.drop.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpcofizab7/{from.md → to.md} +40 -0
tmp/tmpcofizab7/{from.md → to.md} RENAMED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Overview <a id="range.drop.overview">[[range.drop.overview]]</a>
2
+
3
+ `drop_view` produces a `view` excluding the first N elements from
4
+ another `view`, or an empty range if the adapted `view` contains fewer
5
+ than N elements.
6
+
7
+ The name `views::drop` denotes a range adaptor object
8
+ [[range.adaptor.object]]. Let `E` and `F` be expressions, let `T` be
9
+ `remove_cvref_t<decltype((E))>`, and let `D` be
10
+ `range_difference_t<decltype((E))>`. If `decltype((F))` does not model
11
+ `convertible_to<D>`, `views::drop(E, F)` is ill-formed. Otherwise, the
12
+ expression `views::drop(E, F)` is expression-equivalent to:
13
+
14
+ - If `T` is a specialization of `ranges::empty_view`
15
+ [[range.empty.view]], then `((void) F, decay-copy(E))`.
16
+ - Otherwise, if `T` models `random_access_range` and `sized_range` and
17
+ is
18
+ - a specialization of `span` [[views.span]] where
19
+ `T::extent == dynamic_extent`,
20
+ - a specialization of `basic_string_view` [[string.view]],
21
+ - a specialization of `ranges::iota_view` [[range.iota.view]], or
22
+ - a specialization of `ranges::subrange` [[range.subrange]],
23
+
24
+ then
25
+ `T{ranges::begin(E) + min<D>(ranges::size(E), F), ranges::end(E)}`,
26
+ except that `E` is evaluated only once.
27
+ - Otherwise, `ranges::drop_view{E, F}`.
28
+
29
+ [*Example 1*:
30
+
31
+ ``` cpp
32
+ auto ints = views::iota(0) | views::take(10);
33
+ auto latter_half = drop_view{ints, 5};
34
+ for (auto i : latter_half) {
35
+ cout << i << ' '; // prints 5 6 7 8 9
36
+ }
37
+ ```
38
+
39
+ — *end example*]
40
+