[libcxx-commits] [PATCH] D103478: [libc++][compare] Implement three_way_comparable[_with] concepts

Christopher Di Bella via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 22 12:10:06 PDT 2021


cjdb added a comment.

In D103478#2794860 <https://reviews.llvm.org/D103478#2794860>, @Wmbat wrote:

> I would like to bring forward a potential change.
>
> I was looking at how to implement `compare_three_way` and found out that it needs to be present in both `<compare>` and `<functional>` according to the standard draft ( <function> synopsis <http://eel.is/c++draft/functional.syn>, <compare> synopsis <http://eel.is/c++draft/compare.syn> ). It would mean that `compare_three_way` would need to be implemented in a different header and then included in both `<compare>` & `<functional>`, @cjdb  recommends the use of a `__compare/compare_three_way.h` header
>
> Since `compare_three_way` depends on the `three_way_comparable_with` concept ( see here <http://eel.is/c++draft/comparisons.three.way> ), we might also need to move `three_way_comparable` to `__compare/compare_three_way.h` as well. Doing so now might save us the refactor later down the line.
>
> Any thoughts on this?

Please move the concepts into their own header and include it in `<compare>`. You might need to break some other stuff out into their own self-contained headers too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103478/new/

https://reviews.llvm.org/D103478



More information about the libcxx-commits mailing list