Created on 2017-03-24.00:00:00 last changed 69 months ago
Proposed resolution:
This wording is relative to N4659.
Change [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 const as
namespace 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 T is an object type.
[ 2019-02; Kona Wednesday night issue processing ]
This was resolved by the adoption of P0896 in San Diego.
[ 2017-07 Toronto Wed Issue Prioritization ]
Priority 3; Billy to look into arrays of unknown bounds
A customer recently triggered an unexpected SFINAE condition with class path. We constrain the constructor that takes const Source& by asking if iterator_traits<Source>::value_type is one that's OK. This forms iterator_traits<void*>, which is a hard error, as it tries to form void&.
Pointers-to-non-object-type can never act as iterators, as they don't support pointer arithmetic (as we recently discovered in atomic<void*> / atomic<int(*)(int)>).History | |||
---|---|---|---|
Date | User | Action | Args |
2019-02-21 17:23:36 | admin | set | messages: + msg10314 |
2019-02-21 17:23:36 | admin | set | status: new -> resolved |
2017-07-15 22:58:07 | admin | set | messages: + msg9379 |
2017-04-22 17:11:40 | admin | set | messages: + msg9155 |
2017-03-24 00:00:00 | admin | create |