[libcxx-commits] [PATCH] D103478: [libc++][compare] Implement three_way_comparable[_with] concepts
Ruslan Arutyunyan via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jul 12 15:53:34 PDT 2021
rarutyun added a comment.
In D103478#2834101 <https://reviews.llvm.org/D103478#2834101>, @cjdb wrote:
> 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.
Do you want me to make those APIs available from `<functional>` in this review?
================
Comment at: libcxx/include/utility:228
+// cyclic dependency for this header is resolved
+// #include <compare>
#include <initializer_list>
----------------
Still struggling with cyclic dependencies.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103478/new/
https://reviews.llvm.org/D103478
More information about the libcxx-commits
mailing list