From Jason Turner

[func.wrap.general]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp0hatpukc/{from.md → to.md} +21 -0
tmp/tmp0hatpukc/{from.md → to.md} RENAMED
@@ -1,5 +1,26 @@
1
  #### General <a id="func.wrap.general">[[func.wrap.general]]</a>
2
 
3
  Subclause [[func.wrap]] describes polymorphic wrapper classes that
4
  encapsulate arbitrary callable objects.
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  #### General <a id="func.wrap.general">[[func.wrap.general]]</a>
2
 
3
  Subclause [[func.wrap]] describes polymorphic wrapper classes that
4
  encapsulate arbitrary callable objects.
5
 
6
+ Let `t` be an object of a type that is a specialization of `function`,
7
+ `copyable_function`, or `move_only_function`, such that the target
8
+ object `x` of `t` has a type that is a specialization of `function`,
9
+ `copyable_function`, or `move_only_function`. Each argument of the
10
+ invocation of `x` evaluated as part of the invocation of `t` may alias
11
+ an argument in the same position in the invocation of `t` that has the
12
+ same type, even if the corresponding parameter is not of reference type.
13
+
14
+ [*Example 1*:
15
+
16
+ ``` cpp
17
+ move_only_function<void(T)> f{copyable_function<void(T)>{[](T) {}}};
18
+ T t;
19
+ f(t); // it is unspecified how many copies of T are made
20
+ ```
21
+
22
+ — *end example*]
23
+
24
+ *Recommended practice:* Implementations should avoid double wrapping
25
+ when constructing polymorphic wrappers from one another.
26
+