[PATCH] libstdc++: Ensure <bits/ranges_util.h> defines __pair_like
Jonathan Wakely
jwakely@redhat.com
Thu Mar 6 11:27:40 GMT 2025
We need to include <bits/stl_pair.h> in C++23 and later, so that
__pair_like_convertible_from can use __pair_like.
libstdc++-v3/ChangeLog:
* include/bits/ranges_util.h: Include <bits/stl_pair.h>.
---
Very lightly tested on x86_64-linux.
I noticed this because I wanted to use ranges::subrange in a new header
which didn't include <bits/stl_pair.h>.
libstdc++-v3/include/bits/ranges_util.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libstdc++-v3/include/bits/ranges_util.h b/libstdc++-v3/include/bits/ranges_util.h
index 51024ecbebe..d9039e75bf9 100644
--- a/libstdc++-v3/include/bits/ranges_util.h
+++ b/libstdc++-v3/include/bits/ranges_util.h
@@ -35,6 +35,9 @@
# include <bits/utility.h>
# include <bits/invoke.h>
# include <bits/cpp_type_traits.h> // __can_use_memchr_for_find
+#if __glibcxx_tuple_like // >= C++23
+# include <bits/stl_pair.h> // __pair_like
+#endif
#ifdef __glibcxx_ranges
namespace std _GLIBCXX_VISIBILITY(default)
--
2.48.1
More information about the Libstdc++
mailing list