From Jason Turner

[func.bind.partial]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp4tahb0x7/{from.md → to.md} +49 -0
tmp/tmp4tahb0x7/{from.md → to.md} RENAMED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Function templates `bind_front` and `bind_back` <a id="func.bind.partial">[[func.bind.partial]]</a>
2
+
3
+ ``` cpp
4
+ template<class F, class... Args>
5
+ constexpr unspecified bind_front(F&& f, Args&&... args);
6
+ template<class F, class... Args>
7
+ constexpr unspecified bind_back(F&& f, Args&&... args);
8
+ ```
9
+
10
+ Within this subclause:
11
+
12
+ - `g` is a value of the result of a `bind_front` or `bind_back`
13
+ invocation,
14
+ - `FD` is the type `decay_t<F>`,
15
+ - `fd` is the target object of `g` [[func.def]] of type `FD`,
16
+ direct-non-list-initialized with `std::forward<F>(f)`,
17
+ - `BoundArgs` is a pack that denotes `decay_t<Args>...`,
18
+ - `bound_args` is a pack of bound argument entities of `g` [[func.def]]
19
+ of types `BoundArgs...`, direct-non-list-initialized with
20
+ `std::forward<Args>(args)...`, respectively, and
21
+ - `call_args` is an argument pack used in a function call
22
+ expression [[expr.call]] of `g`.
23
+
24
+ *Mandates:*
25
+
26
+ ``` cpp
27
+ is_constructible_v<FD, F> &&
28
+ is_move_constructible_v<FD> &&
29
+ (is_constructible_v<BoundArgs, Args> && ...) &&
30
+ (is_move_constructible_v<BoundArgs> && ...)
31
+ ```
32
+
33
+ is `true`.
34
+
35
+ *Preconditions:* `FD` meets the *Cpp17MoveConstructible* requirements.
36
+ For each `Tᵢ` in `BoundArgs`, if `Tᵢ` is an object type, `Tᵢ` meets the
37
+ *Cpp17MoveConstructible* requirements.
38
+
39
+ *Returns:* A perfect forwarding call
40
+ wrapper [[term.perfect.forwarding.call.wrapper]] `g` with call pattern:
41
+
42
+ - `invoke(fd, bound_args..., call_args...)` for a `bind_front`
43
+ invocation, or
44
+ - `invoke(fd, call_args..., bound_args...)` for a `bind_back`
45
+ invocation.
46
+
47
+ *Throws:* Any exception thrown by the initialization of the state
48
+ entities of `g` [[func.def]].
49
+