[PATCH] Add safe iterator iterator_concept

Jonathan Wakely jwakely@redhat.com
Mon Nov 25 21:40:00 GMT 2019


On 25/11/19 22:25 +0100, François Dumont wrote:
>I plan to commit this patch tomorrow.
>
>    * include/debug/safe_iterator.h
>[__cpp_lib_concepts](_Safe_iterator<>::iterator_concept): Define for
>    C++20.

Thanks.

>François
>

>diff --git a/libstdc++-v3/include/debug/safe_iterator.h b/libstdc++-v3/include/debug/safe_iterator.h
>index 685256551d9..abf575186c7 100644
>--- a/libstdc++-v3/include/debug/safe_iterator.h
>+++ b/libstdc++-v3/include/debug/safe_iterator.h
>@@ -141,6 +141,10 @@ namespace __gnu_debug
>       typedef typename _Traits::reference		reference;
>       typedef typename _Traits::pointer			pointer;
> 
>+#if __cplusplus > 201703L && __cpp_lib_concepts
>+      using iterator_concept = std::__detail::__iter_concept<_Iterator>;
>+#endif
>+
>       /// @post the iterator is singular and unattached
>       _Safe_iterator() _GLIBCXX_NOEXCEPT : _Iter_base() { }
> 



More information about the Gcc-patches mailing list