Skip to content

PL312 25 [algorithms] Fix constraints on ranges comparison algorithms P1716 #308

@wg21bot

Description

@wg21bot

The ranges::is_permutation, ranges::unique, ranges::unique_copy algorithm are currently underconstrained, as they do not require supplied functor to model equivalence relation.
Other compare algorithms (like ranges::equal, ranges::mismatch, ranges::search), are overconstrained. They require supplied functor to model relation<T, U> concept instead of predicate<T, U>, where T and U are reference types of supplied ranges. As consequence, supplied functor needs to be callable with four combinations of arguments: (T, U), (U, T), (U, U), (U, U), instead of just (T, U). This makes them less general than existing non-range overloads, and complicates code migration.

Proposed change:
Adopt P1716R2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions