This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of NAD Concepts status.

1128. Missing definition of iterator_traits<T*>

Section: 24.2 [iterator.synopsis] Status: NAD Concepts Submitter: Alisdair Meredith Opened: 2009-05-28 Last modified: 2021-06-06

Priority: Not Prioritized

View all other issues in [iterator.synopsis].

View all issues with NAD Concepts status.

Discussion:

The <iterator> header synopsis declares a partial specialization of iterator_traits to support pointers, [iterator.syn]. The implication is that specialization will be described in D10, yet it did not follow the rest of the deprecated material into this clause.

However, this is not as bad as it first seems! There are partial specializations of iterator_traits for types that satisfy the various Iterator concepts, and there are concept_maps for pointers to explicitly support the RandomAccessIterator concept, so the required template will be present - just not in the manner advertised.

I can see two obvious solutions:

  1. Restore the iterator_traits<T*> partial specialization in D.10
  2. Remove the declaration of iterator_traits<T*> from 24.3 synopsis

I recommend option (ii) in the wording below

Option (ii) could be extended to strike all the declarations of deprecated material from the synopsis, as it is effectively duplicating D.10 anyway. This is the approach taken for deprecated library components in the 98/03 standards. This is probably a matter best left to the Editor though.

Proposed resolution:

In [iterator.syn] strike:

template<class T> struct iterator_traits<T*>;