This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4280. simd::partial_load uses undefined identifier T

Section: 29.10.7.7 [simd.loadstore] Status: New Submitter: Tim Song Opened: 2025-06-21 Last modified: 2025-06-21

Priority: Not Prioritized

View all issues with New status.

Discussion:

The Effects: element of std::simd::partial_load (after the latest rename) uses T but that is not defined anywhere. It should be V::value_type.

Also, this paragraph should be a Returns: element.

Proposed resolution:

This wording is relative to N5008.

  1. Modify 29.10.7.7 [simd.loadstore] as indicated:

    
    template<class V = see below, ranges::contiguous_range R, class... Flags>
      requires ranges::sized_range<R>
      constexpr V partial_load(R&& r, flags<Flags...> f = {});
    […]
    template<class V = see below, contiguous_iterator I, sized_sentinel_for<I> S, class... Flags>
      constexpr V partial_load(I first, S last, const typename V::mask_type& mask,
                               flags<Flags...> f = {});
    

    -6- […]

    -7- Mandates: […]

    -8- Preconditions: […]

    -9- Effects: Initializes theReturns: A basic_simd object whose ith element is initialized with mask[i] && i < ranges::size(r) ? static_cast<T>(ranges::data(r)[i]) : T() for all i in the range of [0, V::size()), where T is V::value_type.

    -10- Remarks: The default argument for template parameter V is basic_simd<ranges::range_value_t<R>>.