[PATCH] libstdc++: Define flat_set::operator== in terms of ==
Patrick Palka
ppalka@redhat.com
Thu May 29 17:13:22 GMT 2025
Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15?
-- >8 --
... for consistency with the other standard container adaptors
(stack, queue, etc).
libstdc++-v3/ChangeLog:
* include/std/flat_set (_Flat_set_impl::operator==):
Define in terms of ==, not std::equal.
---
libstdc++-v3/include/std/flat_set | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libstdc++-v3/include/std/flat_set b/libstdc++-v3/include/std/flat_set
index c48340d79809..3da8882d154e 100644
--- a/libstdc++-v3/include/std/flat_set
+++ b/libstdc++-v3/include/std/flat_set
@@ -728,7 +728,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
[[nodiscard]]
friend bool
operator==(const _Derived& __x, const _Derived& __y)
- { return std::equal(__x.begin(), __x.end(), __y.begin(), __y.end()); }
+ { return __x._M_cont == __y._M_cont; }
template<typename _Up = value_type>
[[nodiscard]]
--
2.50.0.rc0
More information about the Libstdc++
mailing list