Title
constexpr-wrapper-like needs `remove_cvref_t` in `simd::basic_vec` constructor
Status
wp
Section
[simd.ctor]
Submitter
Hewill Kang

Created on 2025-10-05.00:00:00 last changed 5 days ago

Messages

Date: 2025-11-11.10:48:16

Proposed resolution:

This wording is relative to N5014.

  1. Modify [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 ([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`.

Date: 2025-11-11.10:48:16

[ Kona 2025-11-08; Status changed: Voting → WP. ]

Date: 2025-10-15.00:00:00

[ 2025-10-17; Reflector poll ]

Set status to Tentatively Ready after seven votes in favour during reflector poll.

Date: 2025-10-05.00:00:00

`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.

History
Date User Action Args
2025-11-11 10:48:16adminsetmessages: + msg15653
2025-11-11 10:48:16adminsetstatus: voting -> wp
2025-10-30 17:45:31adminsetstatus: ready -> voting
2025-10-17 10:55:56adminsetmessages: + msg15205
2025-10-17 10:55:56adminsetstatus: new -> ready
2025-10-10 15:25:59adminsetmessages: + msg15136
2025-10-05 00:00:00admincreate