File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ <?xml version =' 1.0' encoding =' utf-8' standalone =' no' ?>
2+ <!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+ <issue num =" 4300" status =" New" >
5+ <title >Missing <i >Returns:</i > element in <tt >optional< T&> ::emplace</tt ></title >
6+ <section ><sref ref =" [optional.ref.assign]" /></section >
7+ <submitter >Giuseppe D'Angelo</submitter >
8+ <date >15 Jul 2025</date >
9+ <priority >99</priority >
10+
11+ <discussion >
12+ <p >
13+ The specification for <tt >optional< T&> ::emplace</tt > in <sref ref =" [optional.ref.assign]" />
14+ is not specifying the returned value via a <i >Returns</i >: element; however the
15+ function does indeed return something (a <tt >T& </tt >). Such a <i >Returns</i >: element is there
16+ for the primary template's `emplace` (cf. <sref ref =" [optional.assign]" />).
17+ </p >
18+ </discussion >
19+
20+ <resolution >
21+ <p >
22+ This wording is relative to this
23+ <a href =" https://github.com/cplusplus/draft/actions/runs/16433597877/artifacts/3583518547" >CD preview draft</a >.
24+ </p >
25+
26+ <ol >
27+
28+ <li ><p >Modify <sref ref =" [optional.ref.assign]" /> as indicated:</p >
29+
30+ <blockquote >
31+ <pre >
32+ template< class U>
33+ constexpr T& emplace(U&& u) noexcept(is_nothrow_constructible_v< T& , U> );
34+ </pre >
35+ <blockquote >
36+ <p >
37+ -4- <i >Constraints</i >: [… ]
38+ <p />
39+ -5- <i >Effects</i >: Equivalent to: <tt ><i >convert-ref-init-val</i >(std::forward< U> (u))</tt >.
40+ <p />
41+ <ins >-?- <i >Returns</i >: <tt >*<i >val</i ></tt >.</ins >
42+ </p >
43+ </blockquote >
44+ </blockquote >
45+ </li >
46+
47+ </ol >
48+ </resolution >
49+
50+ </issue >
You can’t perform that action at this time.
0 commit comments