Skip to content

<algorithm>: std::ranges::unique returns the wrong value for already unique input #1560

@bkentel

Description

@bkentel
std::vector<int> values {1, 2, 3};
auto const [first, last] = std::ranges::unique(values);
values.erase(first, last);
// oops now values is {1, 2}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixedSomething works now, yay!rangesC++20/23 ranges

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions