|
| 1 | +<?xml version='1.0' encoding='utf-8' standalone='no'?> |
| 2 | +<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
| 3 | + |
| 4 | +<issue num="4280" status="New"> |
| 5 | +<title>`simd::partial_load` uses undefined identifier `T`</title> |
| 6 | +<section> |
| 7 | +<sref ref="[simd.loadstore]"/> |
| 8 | +</section> |
| 9 | +<submitter>Tim Song</submitter> |
| 10 | +<date>21 Jun 2025</date> |
| 11 | +<priority>99</priority> |
| 12 | + |
| 13 | +<discussion> |
| 14 | +<p> |
| 15 | +The <i>Effects:</i> element of `std::simd::partial_load` (after the latest rename) uses `T` |
| 16 | +but that is not defined anywhere. It should be `V::value_type`. |
| 17 | +<p/> |
| 18 | +Also, this paragraph should be a <i>Returns:</i> element. |
| 19 | +</p> |
| 20 | +</discussion> |
| 21 | + |
| 22 | +<resolution> |
| 23 | +<p> |
| 24 | +This wording is relative to <paper num="N5008"/>. |
| 25 | +</p> |
| 26 | + |
| 27 | +<ol> |
| 28 | +<li><p>Modify <sref ref="[simd.loadstore]"/> as indicated:</p> |
| 29 | + |
| 30 | +<blockquote> |
| 31 | +<pre><code> |
| 32 | +template<class V = <i>see below</i>, ranges::contiguous_range R, class... Flags> |
| 33 | + requires ranges::sized_range<R> |
| 34 | + constexpr V partial_load(R&& r, flags<Flags...> f = {}); |
| 35 | +[…] |
| 36 | +template<class V = <i>see below</i>, contiguous_iterator I, sized_sentinel_for<I> S, class... Flags> |
| 37 | + constexpr V partial_load(I first, S last, const typename V::mask_type& mask, |
| 38 | + flags<Flags...> f = {}); |
| 39 | +</code></pre> |
| 40 | +<blockquote> |
| 41 | +<p> |
| 42 | +-6- […] |
| 43 | +<p/> |
| 44 | +-7- <i>Mandates</i>: […] |
| 45 | +<p/> |
| 46 | +-8- <i>Preconditions</i>: […] |
| 47 | +<p/> |
| 48 | +-9- <del><i>Effects</i>: Initializes the</del><ins><i>Returns</i>: A `basic_simd` object |
| 49 | +whose</ins> <tt><i>i</i></tt><sup>th</sup> element <ins>is initialized</ins> with |
| 50 | +<tt>mask[<i>i</i>] && <i>i</i> < ranges::size(r) ? static_cast<T>(ranges::data(r)[<i>i</i>]) : T()</tt> |
| 51 | +for all <tt><i>i</i></tt> in the range of <tt>[0, V::size())</tt><ins>, where `T` is `V::value_type`</ins>. |
| 52 | +<p/> |
| 53 | +-10- <i>Remarks</i>: The default argument for template parameter `V` is <tt>basic_simd<ranges::range_value_t<R>></tt>. |
| 54 | +</p> |
| 55 | +</blockquote> |
| 56 | +</blockquote> |
| 57 | +</li> |
| 58 | + |
| 59 | +</ol> |
| 60 | +</resolution> |
| 61 | + |
| 62 | +</issue> |
0 commit comments