Skip to content

[range.slide.view] Replace conditional with call to max #5250

@JohelEGP

Description

@JohelEGP

[range.slide.view] adds (via #5249)

auto sz = ranges::distance(base_) - n_ + 1;
if (sz < 0) sz = 0;
return to-unsigned-like(sz);

Which can be simplified to

auto sz = max({}, ranges::distance(base_) - n_ + 1);
return to-unsigned-like(sz);

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