This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR libstdc++/68222 Hide safe iterator operators


On 18/08/18 22:31 +0200, François Dumont wrote:
Here is the new proposal. It is indeed possible to keep _Safe_iterator and just add a _Category template parameter to it.

While this is still a large patch (obviously, because it's changing a
lot!) I think this version is much easier to understand, and doesn't
add a whole new class unnecessarily. Thanks for updating 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.

Nice.

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 ?

OK for trunk, thanks again.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]