-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[libc++][pair] P2944R3: Constrain std::pair
's equality operator
#136672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
12fc430
6d48213
92544cb
672c7c3
3079b70
40b04ce
3ff0e71
292acd3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
|
||
#include <__compare/common_comparison_category.h> | ||
#include <__compare/synth_three_way.h> | ||
#include <__concepts/boolean_testable.h> | ||
#include <__concepts/different_from.h> | ||
#include <__config> | ||
#include <__cstddef/size_t.h> | ||
|
@@ -447,7 +448,14 @@ pair(_T1, _T2) -> pair<_T1, _T2>; | |
|
||
template <class _T1, class _T2, class _U1, class _U2> | ||
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool | ||
operator==(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) { | ||
operator==(const pair<_T1, _T2>& __x, const pair<_U1, _U2>& __y) | ||
#if _LIBCPP_STD_VER >= 26 | ||
requires requires { | ||
{ __x.first == __y.first } -> __boolean_testable; | ||
{ __x.second == __y.second } -> __boolean_testable; | ||
} | ||
Comment on lines
+467
to
+470
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we have the same situation as in #135759? (that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The standard requirements are inconsistent among these new constraints. I guess the difference was because of that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As @frederick-vs-ja pointed out these are described as |
||
#endif | ||
{ | ||
return __x.first == __y.first && __x.second == __y.second; | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.