[gcc r16-6764] libstdc++: Add comment justifying separate proxy_random_access_iterator_wrapper.
Tomasz Kaminski
tkaminsk@gcc.gnu.org
Wed Jan 14 10:44:19 GMT 2026
https://gcc.gnu.org/g:e16de4a10f5874f83a53dd7216c7919375b34d94
commit r16-6764-ge16de4a10f5874f83a53dd7216c7919375b34d94
Author: Tomasz Kamiński <tkaminsk@redhat.com>
Date: Wed Jan 14 10:35:59 2026 +0100
libstdc++: Add comment justifying separate proxy_random_access_iterator_wrapper.
It meets Cpp17RandomAccessIterator requirements, but does not satisfy
random_access_iterator concept.
libstdc++-v3/ChangeLog:
* testsuite/util/testsuite_iterators.h: Modify comment.
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
Diff:
---
libstdc++-v3/testsuite/util/testsuite_iterators.h | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/libstdc++-v3/testsuite/util/testsuite_iterators.h b/libstdc++-v3/testsuite/util/testsuite_iterators.h
index caede49e41b5..ca022e5d0f9c 100644
--- a/libstdc++-v3/testsuite/util/testsuite_iterators.h
+++ b/libstdc++-v3/testsuite/util/testsuite_iterators.h
@@ -695,9 +695,12 @@ namespace __gnu_test
* @brief random_access_iterator wrapper for pointer,
* that returns proxy from subscript.
*
- * This class takes a pointer and wraps it to provide exactly
- * the requirements of a random_access_iterator. It should not be
- * instantiated directly, but generated from a test_container
+ * This is separate from random_access_iterator_wrapper (that returns
+ * T& from operator subscript), as it meets the requirements of
+ * Cpp17RandomAccessIterator (C++20 [tab:randomaccessiterator])
+ * that allows to return type that is convertible to reference,
+ * but does not satisfy random_access_iterator concept
+ * (C++20 [random_access_iterator]).
*/
template<class T>
struct proxy_random_access_iterator_wrapper
More information about the Libstdc++-cvs
mailing list