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

Wmbat via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 2 15:20:35 PDT 2021


Wmbat added a comment.

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/function.objects>, <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?


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