Skip to content

incorrect SFINAE constraint on (static)_simd_cast #66

@mattkretz

Description

@mattkretz

[parallel.simd.casts] p5 and p11 allow all non-simd types T. p5 has a implicit requirement of an arithmetic type, since it must be able to represent all possible values of U (note a misspelled To, that should be T in p5). But one could argue that a UDT can fulfill this requirement. Since only vectorizable types T are valid for simd<T>, the constraint should use this term instead.

Proposed resolution:

9.4.5/5
Remarks: The function shall not participate in overload resolution unless

  • every possible value of type U can be represented with type ToT, and
  • either
    • is_simd_v<T> is falseT is a vectorizable type, or
    • is_simd_v<T> and T::size() == simd<U, Abi>::size() isare true.

9.4.5/11
Remarks: The function shall not participate in overload resolution unless either

  • is_simd_v<T> is falseT is a vectorizable type, or
  • is_simd_v<T> and T::size() == simd<U, Abi>::size() isare true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions