[libcxx-commits] [libcxx] [libc++] Make `flat_(multi)map`'s iterators require `operator<=>` (PR #131290)
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Mar 18 11:04:03 PDT 2025
================
@@ -139,9 +141,12 @@ struct __key_value_iterator {
return !(__x < __y);
}
- _LIBCPP_HIDE_FROM_ABI friend auto operator<=>(const __key_value_iterator& __x, const __key_value_iterator& __y)
- requires three_way_comparable<__key_iterator>
- {
+ _LIBCPP_HIDE_FROM_ABI friend strong_ordering
+ operator<=>(const __key_value_iterator& __x, const __key_value_iterator& __y) {
----------------
mordante wrote:
Based on [[[structure.specifications]](http://eel.is/c++draft/structure.specifications)/3.1](http://eel.is/c++draft/structure#specifications-3.1) it means "the conditions for the function's participation in overload resolution ([[over.match]](http://eel.is/c++draft/over.match))[.](http://eel.is/c++draft/structure#specifications-3.1.sentence-1)".
Note I did not validate whether or not there are issues in the specification in the Standard.
> I think we can just require the well-formedness of operator<=>.
What do you mean with require? a constraint or a mandate?
https://github.com/llvm/llvm-project/pull/131290
More information about the libcxx-commits
mailing list