4407. constexpr-wrapper-like needs remove_cvref_t in simd::basic_vec constructor

Section: 29.10.7.2 [simd.ctor] Status: New Submitter: Hewill Kang Opened: 2025-10-05 Last modified: 2025-10-10

Priority: Not Prioritized

View other active issues in [simd.ctor].

View all other issues in [simd.ctor].

View all issues with New status.

Discussion:

decltype(From::value) would be const int& if From is a type of std::cw<42>, so the reference also needs to be removed for checking the arithmetic type.

Proposed resolution:

This wording is relative to N5014.

  1. Modify 29.10.7.2 [simd.ctor] as indicated:

    template<class U> constexpr explicit(see below) basic_vec(U&& value) noexcept;
    

    -1- Let From denote the type remove_cvref_t<U>.

    […]

    -4- Remarks: The expression inside explicit evaluates to false if and only if U satisfies convertible_to<value_type>, and either

    1. (4.1) — From is not an arithmetic type and does not satisfy constexpr-wrapper-like,

    2. (4.2) — From is an arithmetic type and the conversion from From to value_type is value-preserving (29.10.1 [simd.general]), or

    3. (4.3) — From satisfies constexpr-wrapper-like, remove_cvref_tremove_const_t<decltype(From::value)> is an arithmetic type, and From::value is representable by value_type.