|
| 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&</code> if `From` is a type of <code>std::cw<42></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<class U> constexpr explicit(<i>see below</i>) basic_vec(U&& value) noexcept; |
| 33 | +</pre> |
| 34 | +<blockquote> |
| 35 | +<p> |
| 36 | +-1- Let `From` denote the type <tt>remove_cvref_t<U></tt>. |
| 37 | +<p/> |
| 38 | +[…] |
| 39 | +<p/> |
| 40 | +-4- <i>Remarks</i>: The expression inside `explicit` evaluates to `false` if and only if `U` |
| 41 | +satisfies <code>convertible_to<value_type></code>, and either |
| 42 | +</p> |
| 43 | +<ol style="list-style-type: none"> |
| 44 | +<li><p> |
| 45 | +(4.1) — `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) — `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) — `From` satisfies <code><i>constexpr-wrapper-like</i></code>, |
| 53 | +<code><ins>remove_cvref_t</ins><del>remove_const_t</del><decltype(From::value)></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