From Jason Turner

[func.bind]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpyxsw4q_k/{from.md → to.md} +12 -6
tmp/tmpyxsw4q_k/{from.md → to.md} RENAMED
@@ -1,9 +1,11 @@
1
  ### Function object binders <a id="func.bind">[[func.bind]]</a>
2
 
3
- This subclause describes a uniform mechanism for binding arguments of
4
- callable objects.
 
 
5
 
6
  #### Class template `is_bind_expression` <a id="func.bind.isbind">[[func.bind.isbind]]</a>
7
 
8
  ``` cpp
9
  namespace std {
@@ -31,12 +33,12 @@ namespace std {
31
  template<class T> struct is_placeholder; // see below
32
  }
33
  ```
34
 
35
  The class template `is_placeholder` can be used to detect the standard
36
- placeholders `_1`, `_2`, and so on. The function template `bind` uses
37
- `is_placeholder` to detect placeholders.
38
 
39
  Specializations of the `is_placeholder` template shall meet the
40
  *Cpp17UnaryTypeTrait* requirements [[meta.rqmts]]. The implementation
41
  provides a definition that has the base characteristic of
42
  `integral_constant<int, J>` if `T` is the type of
@@ -80,11 +82,11 @@ $w_N$) [[func.require]] is a valid expression for some values `w₁`,
80
 
81
  *Returns:* An argument forwarding call wrapper `g` [[func.require]]. A
82
  program that attempts to invoke a volatile-qualified `g` is ill-formed.
83
  When `g` is not volatile-qualified, invocation of
84
  `g(``u₁``, ``u₂``, `…`, ``u_M``)` is
85
- expression-equivalent [[defns.expression-equivalent]] to
86
 
87
  ``` cpp
88
  INVOKE(static_cast<$V_fd$>($v_fd$),
89
  static_cast<$V_1$>($v_1$), static_cast<$V_2$>($v_2$), …, static_cast<$V_N$>($v_N$))
90
  ```
@@ -129,20 +131,22 @@ type `V`_`fd` is `cv FD&`.
129
 
130
  #### Placeholders <a id="func.bind.place">[[func.bind.place]]</a>
131
 
132
  ``` cpp
133
  namespace std::placeholders {
134
- // M is the implementation-defined number of placeholders
135
  see below _1;
136
  see below _2;
137
  .
138
  .
139
  .
140
  see below _M;
141
  }
142
  ```
143
 
 
 
144
  All placeholder types meet the *Cpp17DefaultConstructible* and
145
  *Cpp17CopyConstructible* requirements, and their default constructors
146
  and copy/move constructors are constexpr functions that do not throw
147
  exceptions. It is *implementation-defined* whether placeholder types
148
  meet the *Cpp17CopyAssignable* requirements, but if so, their copy
@@ -159,5 +163,7 @@ If they are not, they are declared as:
159
 
160
  ``` cpp
161
  extern unspecified _1;
162
  ```
163
 
 
 
 
1
  ### Function object binders <a id="func.bind">[[func.bind]]</a>
2
 
3
+ #### General <a id="func.bind.general">[[func.bind.general]]</a>
4
+
5
+ Subclause [[func.bind]] describes a uniform mechanism for binding
6
+ arguments of callable objects.
7
 
8
  #### Class template `is_bind_expression` <a id="func.bind.isbind">[[func.bind.isbind]]</a>
9
 
10
  ``` cpp
11
  namespace std {
 
33
  template<class T> struct is_placeholder; // see below
34
  }
35
  ```
36
 
37
  The class template `is_placeholder` can be used to detect the standard
38
+ placeholders `_1`, `_2`, and so on [[func.bind.place]]. The function
39
+ template `bind` uses `is_placeholder` to detect placeholders.
40
 
41
  Specializations of the `is_placeholder` template shall meet the
42
  *Cpp17UnaryTypeTrait* requirements [[meta.rqmts]]. The implementation
43
  provides a definition that has the base characteristic of
44
  `integral_constant<int, J>` if `T` is the type of
 
82
 
83
  *Returns:* An argument forwarding call wrapper `g` [[func.require]]. A
84
  program that attempts to invoke a volatile-qualified `g` is ill-formed.
85
  When `g` is not volatile-qualified, invocation of
86
  `g(``u₁``, ``u₂``, `…`, ``u_M``)` is
87
+ expression-equivalent [[defns.expression.equivalent]] to
88
 
89
  ``` cpp
90
  INVOKE(static_cast<$V_fd$>($v_fd$),
91
  static_cast<$V_1$>($v_1$), static_cast<$V_2$>($v_2$), …, static_cast<$V_N$>($v_N$))
92
  ```
 
131
 
132
  #### Placeholders <a id="func.bind.place">[[func.bind.place]]</a>
133
 
134
  ``` cpp
135
  namespace std::placeholders {
136
+ // M is the number of placeholders
137
  see below _1;
138
  see below _2;
139
  .
140
  .
141
  .
142
  see below _M;
143
  }
144
  ```
145
 
146
+ The number `M` of placeholders is *implementation-defined*.
147
+
148
  All placeholder types meet the *Cpp17DefaultConstructible* and
149
  *Cpp17CopyConstructible* requirements, and their default constructors
150
  and copy/move constructors are constexpr functions that do not throw
151
  exceptions. It is *implementation-defined* whether placeholder types
152
  meet the *Cpp17CopyAssignable* requirements, but if so, their copy
 
163
 
164
  ``` cpp
165
  extern unspecified _1;
166
  ```
167
 
168
+ Placeholders are freestanding items [[freestanding.item]].
169
+