PR libstdc++/68222 Hide safe iterator operators

François Dumont frs.dumont@gmail.com
Sat Aug 18 20:31:00 GMT 2018


Here is the new proposal. It is indeed possible to keep _Safe_iterator 
and just add a _Category template parameter to it.

I introduce a friend declaration to access container _Base nested 
typedef from the safe iterator.

I review the safe const_iterator constructor from safe iterator. I now 
check if we are in the a const_iterator context so that compilers don't 
even try to consider this constructor when we are in an iterator context.

I adapted _Safe_local_iterator the same way to keep consistency with 
_Safe_iterator and because I find the new design cleaner. It also fixes 
the same problem I fixed on _Safe_iterator when checking it iterator has 
been initialized using _MutableIterator() rather than _Iterator().

I stop overloading __get_distance for safe iterators or safe local 
iterators, it was useless. I prefer to introduce similar functions as 
members. Same for __get_distance_from_begin or __get_distance_to_end, 
and I move code in safe_iterator.tcc.

Tested under Linux x86_64 debug mode.

Ok to commit ?

François
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr68622.patch
Type: text/x-patch
Size: 75806 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20180818/f365679f/attachment.bin>


More information about the Libstdc++ mailing list