Title
simd::basic_vec(U&&) default template parameter
Status
lewg
Section
[simd.ctor]
Submitter
Hewill Kang

Created on 2025-09-29.00:00:00 last changed 1 month ago

Messages

Date: 2025-10-22.12:32:36

Proposed resolution:

This wording is relative to N5014.

  1. Modify [simd.overview] as indicated:

    namespace std::simd {
      template<class T, class Abi> class basic_vec {
      public:
        […]
        template<class U = T>
          constexpr explicit(see below) basic_vec(U&& value) noexcept;
        […]
      };
    }
    
  2. Modify [simd.ctor] as indicated:

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

    -1- […]

Date: 2025-10-15.00:00:00

[ 2025-10-22; Reflector poll. Status changed: New → LEWG with priority 4. ]

This narrows design space wrt using braces for initialization of basic_vec, especially if we allow user-defined types.

LWG 4230 would address this by allowing vec<complex<double>>(1., 1.);

Date: 2025-09-29.00:00:00

simd::basic_vec supports complex after P2663R7, defaulting the template parameter of its broadcast constructor seems to be reasonable, as this allows the intuitive spelling:

simd::vec<complex<double>> sc1   ({-1.0, 0.5}); // current ill-formed
simd::vec<complex<double>> sc2 = {{-1.0, 0.5}}; // current ill-formed
History
Date User Action Args
2025-10-22 12:32:36adminsetmessages: + msg15343
2025-10-22 12:32:36adminsetstatus: new -> lewg
2025-10-03 13:44:03adminsetmessages: + msg15098
2025-09-29 00:00:00admincreate