P4276R0 — A Policy for Scalar Overloads in std::simd
Daniel Towner
LEWG
`std::simd` includes scalar overloads for a few operations where variants of a function or operator accept a scalar where a `simd::vec` value would otherwise be expected. Recent papers continue this theme, with better shifts [P3793R1] and funnel shifts [P4010R0] adding scalar-operand variants. This has inadvertently created an expectation that every new operation should provide scalar overloads too, but they are not needed by default. In each case where they exist, they do so for a specific, demonstrable reason, such as access to a distinct hardware instruction.