Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 70 additions & 2 deletions xml/issue4264.xml
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,8 @@ Set priority to 2 after reflector poll.
Strong oposition to making it unspecified whether <tt>function_ref</tt> constructed from
other <tt>function_ref</tt> will reference source object or its target directly.
</p>
</discussion>

<resolution>
<superseded>
<p>
This wording is relative to <paper num="N5008"/>.
</p>
Expand Down Expand Up @@ -237,6 +236,75 @@ f2(); // it is unspecified if `f1` or `f2` is invoked</ins>
</li>
</ol>

</superseded>

<note>2025-11-06, Tomasz provides updated wording correcting example</note>

</discussion>

<resolution>
<p>
This wording is relative to <paper num="N5014"/>.
</p>
<ol>

<li><p>Modify <sref ref="[func.wrap.general]"/> as indicated:</p>

<blockquote>
<p>
-2- Let <tt>t</tt> be an object of a type that is a specialization of <tt>function</tt>,
<tt>copyable_function</tt>, <del>or</del> <tt>move_only_function</tt><ins>, or <tt>function_ref</tt></ins>,
such that the target object <tt>x</tt> of <tt>t</tt> has a type that is a specialization of <tt>function</tt>,
<tt>copyable_function</tt>, <del>or</del><tt>move_only_function</tt><ins>, or <tt>function_ref</tt></ins>.
Each argument of the invocation of <tt>x</tt> evaluated as part of the invocation of <tt>t</tt>
may alias an argument in the same position in the invocation of <tt>t</tt> that has the same type,
even if the corresponding parameter is not of reference type.
</p>
</blockquote>

</li>

<li><p>Modify <sref ref="[func.wrap.ref.ctor]"/> as indicated:</p>

<blockquote>
<pre>
template&lt;class F&gt; constexpr function_ref(F&amp;&amp;) noexcept;
</pre>
<blockquote>
[&hellip;]
<p>
-7- <i>Effects</i>:
Initializes <tt><i>bound-entity</i></tt> with <tt>addressof(f)</tt>
and <tt><i>thunk-ptr</i></tt> with the address of a function <tt><i>thunk</i></tt> such that
<tt><i>thunk</i>(<i>bound-entity</i>, <i>call-args</i>...)</tt> is expression-equivalent
(<sref ref="[defns.expression.equivalent]"/>) to
<tt>invoke_r&lt;R&gt;(static_cast&lt;cv T&amp;&gt;(f), <i>call-args</i>...)</tt>.
</p>
<p>
<ins>-?- <i>Remarks</i>:
If <tt>remove_cvref_t&lt;F&gt;</tt> is a specialization of <tt>function_ref</tt> an implementation
may initialize <tt><i>bound-entity</i></tt> with <tt><i>bound-entity</i></tt> of <tt>f</tt>.
[<i>Example</i>:</ins>
</p>
<pre>
<ins>void f1() noexcept;
void f2() noexcept;

function_ref&lt;void() noexcept&gt; r1(&amp;f1);
function_ref&lt;void()&gt; r2(r1);
r2(); // f1 is invoked
r1 = &amp;f2;
r2(); // it is unspecified if f1 or f2 is invoked</ins>
</pre>
<p>
<ins>&mdash; <i>end example</i>]</ins>
</p>
</blockquote>
</blockquote>

</li>
</ol>


</resolution>

Expand Down
78 changes: 76 additions & 2 deletions xml/issue4308.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ The aliases shouldn't be defined for non-object types, but probably harmless."
<p>
<tt>optional&lt;T&amp;&gt;</tt> doesn't currently allow incomplete types anyway.
</p>
</discussion>

<resolution>
<superseded>
<p>
This wording is relative to <paper num="N5014"/>.
</p>
Expand Down Expand Up @@ -79,7 +78,82 @@ type because it is not an actual iterator type. &mdash; <i>end note</i>]</ins>

</li>

</ol>
</superseded>

<note>2025-11-06, Tomasz provides updated</note>
</discussion>

<resolution>

<ol>

<li><p>Modify <sref ref="[optional.optional.ref.general]"/> as indicated:</p>
<blockquote>
<pre>
namespace std {
template&lt;class T&gt;
class optional&lt;T&amp;&gt; {
public:
using value_type = T;
using iterator = implementation-defined; // <ins>present only if T is object type other than array of unknown bound;</ins> see [optional.ref.iterators]
public:
[&hellip;]

// [optional.ref.iterators], iterator support
constexpr <del>iterator</del><ins>auto</ins> begin() const noexcept;
constexpr <del>iterator</del><ins>auto</ins> end() const noexcept;

[&hellip;]
};
}
</pre>
</blockquote>
</li>
<li><p>Modify <sref ref="[optional.ref.iterators]"/> as indicated:</p>

<blockquote>
<pre>
using iterator = <i>implementation-defined</i>; <ins>// present only if T is object type other than array of unknown bound</ins>
</pre>
<blockquote>
<p>
-1- This type models `contiguous_iterator` (<sref ref="[iterator.concept.contiguous]"/>), meets the
<i>Cpp17RandomAccessIterator</i> requirements (<sref ref="[random.access.iterators]"/>), and meets
the requirements for constexpr iterators (<sref ref="[iterator.requirements.general]"/>), with value
type <tt>remove_cv_t&lt;T&gt;</tt>. The reference type is <tt>T&amp;</tt> for `iterator`.
</p>
<p>
-2- All requirements on container iterators (<sref ref="[container.reqmts]"/>) apply to
`optional::iterator`.
</p>
</blockquote>

<pre>
constexpr <del>iterator</del><ins>auto</ins> begin() const noexcept;
</pre>
<blockquote>
<p><ins>-?- <i>Constraints</i>: T is an object type other than array of unknown bound.</ins></p>
<p>
-3- Returns: <ins>An object `i` of `iterator` type, such that</ins><del>If `has_value()` is `true`,</del>
<ins>`i` is</ins> an iterator referring to `*val` <ins>if `has_value()` is `true`, and</ins><del>Otherwise, </del>
a past-the-end iterator value <ins>otherwise</ins>.
</p>
</blockquote>

<pre>
constexpr <del>iterator</del><ins>auto</ins> end() const noexcept;
</pre>
<blockquote>
<p><ins>-?- <i>Constraints</i>: T is an object type other than array of unknown bound.</ins></p>
<p>-4- Returns: `begin() + has_value()`.</p>
</blockquote>
</blockquote>

</li>

</ol>
</resolution>


</issue>