Skip to content

exclusive_less_than may not be compliant with C++ standard requirements for comparator #51

@honnesh

Description

@honnesh

Hello,

We recently updated to clang 22 and we found a potential issue with exclusive_less_than implemented in https://github.com/boostorg/icl/blob/develop/include/boost/icl/detail/exclusive_less_than.hpp. As per the C++ standard requirements for a comparator detailed in https://en.cppreference.com/w/cpp/named_req/Compare.html, exclusive_less_than violates the transitive property of equivalence highlighted here:

Image

An example situation is the case of
a = [3 5), b = [4 7) and c = [6 8)

I believe this non-compliance is exposed with clang 22. Please let me know if I am missing something here.

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