Skip to content

P2642: Avoid division by zero #442

@mhoemmen

Description

@mhoemmen

Para 12.3 of the converting constructor from layout_stride::mapping explicitly divides by zero if the leftmost resp. rightmost extent is zero.

This a general issue with other constructors as well, e.g., if padding_value is zero.

The two-parameter constructor mapping(ext, pad) has a precondition that extents_type::index-cast(pad) is greater than zero. Thus, we already check in some cases. We should consider extending these checks to all the cases, so the mappings behave reasonably.

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