1212<p >
1313The standard currently requires that constructing <code >move_only_function</code >
1414from empty <code >copyable_function</code >, creates an non-empty <code >move_only_function</code >,
15- that contains an empty <code >copyable_function</code > as the target. For exampe:
16- <code >
15+ that contains an empty <code >copyable_function</code > as the target. For example:
16+ </p >
17+ <blockquote ><pre >
1718std::copyable_function< int(int)> ce;
1819std::move_only_function< int(int)> me(ce);
19- </code >
20+ </pre ></blockquote >
21+ <p >
2022We require that invoking <code >me(1)</code > is undefined behavior (as it leads to call to the
2123<code >ce(1)</code >), however it cannot be detected in the user code, as <code >me != nullptr</code >
2224is true.
2325</p >
24-
2526<p >
26- We should require that the <code >move_only_function(F&& f)</code > constructor to create an
27- empty object, if <code >f</code > is instantiation of of <code >copyable_function</code > and
28- <code >f == nullptr</code > is true, i.e. f does not contain target object.
27+ We should require the <code >move_only_function(F&& f)</code > constructor to create an
28+ empty object, if <code >f</code > is an instantiation of <code >copyable_function</code > and
29+ <code >f == nullptr</code > is true, i.e. `f` does not contain target object.
2930</p >
30-
3131<p >
3232This simplifies implementing avoidance of double wrapping per <sref ref =" [func.wrap.general]" /> p2,
33- as transfering the target produces empty functor.
33+ as transferring the target produces an empty functor.
3434</p >
35-
3635<p >
3736The <code >copyable_function</code > cannot be constructed from <code >move_only_function</code >,
38- as it requires functor to be copyable. Invkoing an empty <code >std::function</code > has well
37+ as it requires functor to be copyable. Invoking an empty <code >std::function</code > has well
3938defined behavior (throws <code >bad_function_call</code >), and wrapping such object into
40- other functors should reproduce that behavior
39+ other functors should reproduce that behavior.
4140</p >
42-
4341</discussion >
4442
4543<resolution >
@@ -56,13 +54,15 @@ template<class F> move_only_function(F&& f);
5654</pre >
5755<blockquote >
5856[… ]
59- <p >-8- <i >Postconditions:</i >: <tt >*this</tt > has no target object if any of the following hold:</p >
60- <ul >
61- <li ><p >(8.1) <tt >f</tt > is a null function pointer value, <del >or</del ></p ></li >
62- <li ><p >(8.2) <tt >f</tt > is a null member pointer value, or</p ></li >
63- <li ><p >(8.2) <tt >remove_cvref_t< F> </tt > is a specialization of the <tt >move_only_function</tt >
64- <ins >or <tt >copyable_function</tt ></ins > class template, and <tt >f</tt > has no target object.</p ></li >
65- </ul >
57+ <p >
58+ -8- <i >Postconditions:</i >: <tt >*this</tt > has no target object if any of the following hold:
59+ </p >
60+ <ol style =" list-style-type: none" >
61+ <li ><p >(8.1) — <tt >f</tt > is a null function pointer value, <del >or</del ></p ></li >
62+ <li ><p >(8.2) — <tt >f</tt > is a null member pointer value, or</p ></li >
63+ <li ><p >(8.2) — <tt >remove_cvref_t< F> </tt > is a specialization of the <tt >move_only_function</tt >
64+ <ins >or <tt >copyable_function</tt ></ins > class template, and <tt >f</tt > has no target object.</p ></li >
65+ </ol >
6666</blockquote >
6767</blockquote >
6868
0 commit comments