Skip to content

Additional constexpr tests and tests versus views::drop | views::take #4

@JeffGarland

Description

@JeffGarland

In the design section of the paper the author says this:

Should we introduce a new slice_view class?

Nope.

As stated in P2214: "slice(M, N) is equivalent to views::drop(M) | views::take(N - M), and you couldn't do much better as a first class view. range-v3 also supports a flavor that works as views::slice(M, end - N) for a special variable end, which likewise be equivalent to r | views::drop(M) | views::drop_last(N)."

This means that slice(M, N) can simply be a trivial alias of the latter two, and author believes that such a design has fully accommodated the current desires.

We should have some tests that validate the correctness of that statement.

Also some constexpr tests using static_assert to ensure constexpr is working correctly.

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