Skip to content

Constructor allows conversion from dynamic extent to static size. #89

@T-Bakker

Description

@T-Bakker

Hi, a constructor in the nonstd::span allows implicit conversion from a nonstd::span<T, dynamic_extent> to nonstd::span<T, N>:

(Extent == dynamic_extent || OtherExtent == dynamic_extent || Extent == OtherExtent)

I believe this is not desired as nothing guarantees that the dynamic span has the correct size. I believe the code should be:
(Extent == dynamic_extent || Extent == OtherExtent)

This only allows conversion if this is dynamic_extent or if the sizes match. Conversions from dynamic_extent to static are no longer allowed.

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