Here is the _Safe_iterator one. Doing so I noticed that pointer_traits rebind for __normal_iterator was wrong and added tests on it. For _Safe_iterator maybe I should specialize only when instantiated with __normal_iterator ? Or maybe limit to random_access_iterator_tag ? Whatever the pointer_to implementation is problematic, we can only produce singular iterator as I did ifor now. François On 28/09/21 9:25 pm, Jonathan Wakely via Libstdc++ wrote: > This allows std::__to_address to be used with __normal_iterator in > C++11/14/17 modes. Without the partial specialization the deduced > pointer_traits::element_type is incorrect, and so the return type of > __to_address is wrong. > > A similar partial specialization is probably needed for > __gnu_debug::_Safe_iterator. > > Signed-off-by: Jonathan Wakely > > libstdc++-v3/ChangeLog: > > * include/bits/stl_iterator.h (pointer_traits): Define partial > specialization for __normal_iterator. > * testsuite/24_iterators/normal_iterator/to_address.cc: New test. > > Tested x86_64-linux. Committed to trunk. >