This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofResolved status.
iterator_traits should SFINAE forvoid* and function pointersSection: 24.3.2.3[iterator.traits]Status:ResolvedSubmitter: Billy Robert O'Neal IIIOpened: 2017-03-24Last modified: 2020-09-06
Priority:3
View all otherissues in [iterator.traits].
View all issues withResolved status.
Discussion:
A customer recently triggered an unexpected SFINAE condition with classpath. We constrain the constructor that takesconst Source& by asking ifiterator_traits<Source>::value_type is one that's OK. This formsiterator_traits<void*>, which is a hard error, as it tries to formvoid&.
atomic<void*> /atomic<int(*)(int)>).[2017-07 Toronto Wed Issue Prioritization]
Priority 3; Billy to look into arrays of unknown bounds
[2019-02; Kona Wednesday night issue processing]
This was resolved by the adoption ofP0896 in San Diego.
Proposed resolution:
This wording is relative toN4659.
Change 24.3.2.3[iterator.traits] as indicated:
-3- It is specialized for pointers as
namespace std { template<class T> struct iterator_traits<T*> { using difference_type = ptrdiff_t; using value_type = T; using pointer = T*; using reference = T&; using iterator_category = random_access_iterator_tag; };}and for pointers to
constasnamespace std { template<class T> struct iterator_traits<const T*> { using difference_type = ptrdiff_t; using value_type = T; using pointer = const T*; using reference = const T&; using iterator_category = random_access_iterator_tag; };}-?- These partial specializations for pointers apply only when
Tis an object type.