From Jason Turner

[range.zip.transform.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp2twq6yl7/{from.md → to.md} +36 -0
tmp/tmp2twq6yl7/{from.md → to.md} RENAMED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Overview <a id="range.zip.transform.overview">[[range.zip.transform.overview]]</a>
2
+
3
+ `zip_transform_view` takes an invocable object and any number of views
4
+ and produces a view whose Mᵗʰ element is the result of applying the
5
+ invocable object to the Mᵗʰ elements of all views.
6
+
7
+ The name `views::zip_transform` denotes a customization point object
8
+ [[customization.point.object]]. Let `F` be a subexpression, and let
9
+ `Es...` be a pack of subexpressions.
10
+
11
+ - If `Es` is an empty pack, let `FD` be `decay_t<decltype((F))>`.
12
+ - If `move_constructible<FD> &&
13
+ regular_invocable<FD&>` is `false`, or if
14
+ `decay_t<invoke_result_t<FD&>>` is not an object type,
15
+ `views::zip_transform(F, Es...)` is ill-formed.
16
+ - Otherwise, the expression `views::zip_transform(F, Es...)` is
17
+ expression-equivalent to
18
+ ``` cpp
19
+ ((void)F, auto(views::empty<decay_t<invoke_result_t<FD&>>>))
20
+ ```
21
+ - Otherwise, the expression `views::zip_transform(F, Es...)` is
22
+ expression-equivalent to `zip_transform_view(F, Es...)`.
23
+
24
+ [*Example 1*:
25
+
26
+ ``` cpp
27
+ vector v1 = {1, 2};
28
+ vector v2 = {4, 5, 6};
29
+
30
+ for (auto i : views::zip_transform(plus(), v1, v2)) {
31
+ cout << i << ' '; // prints 5 7
32
+ }
33
+ ```
34
+
35
+ — *end example*]
36
+