Skip to content

Commit e14d9e2

Browse files
committed
New issue from Hewill: "constexpr-wrapper-like needs remove_cvref_t in simd::basic_vec constructor"
1 parent 3d1a1b7 commit e14d9e2

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

xml/issue4407.xml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4407" status="New">
5+
<title><code><i>constexpr-wrapper-like</i></code> needs `remove_cvref_t` in `simd::basic_vec`
6+
constructor</title>
7+
<section>
8+
<sref ref="[simd.ctor]"/>
9+
</section>
10+
<submitter>Hewill Kang</submitter>
11+
<date>05 Oct 2025</date>
12+
<priority>99</priority>
13+
14+
<discussion>
15+
<p>
16+
`decltype(From::value)` would be <code>const int&amp;</code> if `From` is a type of <code>std::cw&lt;42&gt;</code>,
17+
so the reference also needs to be removed for checking the arithmetic type.
18+
</p>
19+
</discussion>
20+
21+
<resolution>
22+
<p>
23+
This wording is relative to <paper num="N5014"/>.
24+
</p>
25+
26+
<ol>
27+
28+
<li><p>Modify <sref ref="[simd.ctor]"/> as indicated:</p>
29+
30+
<blockquote>
31+
<pre>
32+
template&lt;class U&gt; constexpr explicit(<i>see below</i>) basic_vec(U&amp;&amp; value) noexcept;
33+
</pre>
34+
<blockquote>
35+
<p>
36+
-1- Let `From` denote the type <tt>remove_cvref_t&lt;U&gt;</tt>.
37+
<p/>
38+
[&hellip;]
39+
<p/>
40+
-4- <i>Remarks</i>: The expression inside `explicit` evaluates to `false` if and only if `U`
41+
satisfies <code>convertible_to&lt;value_type&gt;</code>, and either
42+
</p>
43+
<ol style="list-style-type: none">
44+
<li><p>
45+
(4.1) &mdash; `From` is not an arithmetic type and does not satisfy <code><i>constexpr-wrapper-like</i></code>,
46+
</p></li>
47+
<li><p>
48+
(4.2) &mdash; `From` is an arithmetic type and the conversion from `From` to `value_type` is
49+
value-preserving (<sref ref="[simd.general]"/>), or
50+
</p></li>
51+
<li><p>
52+
(4.3) &mdash; `From` satisfies <code><i>constexpr-wrapper-like</i></code>,
53+
<code><ins>remove_cvref_t</ins><del>remove_const_t</del>&lt;decltype(From::value)&gt;</code>
54+
is an arithmetic type, and `From::value` is representable by `value_type`.
55+
</p></li>
56+
</ol>
57+
</blockquote>
58+
</blockquote>
59+
</li>
60+
</ol>
61+
62+
</resolution>
63+
64+
</issue>

0 commit comments

Comments
 (0)