|
5477 | 5477 | template<@\libconcept{input_iterator}@ I, class S>
|
5478 | 5478 | struct iterator_traits<common_iterator<I, S>> {
|
5479 | 5479 | using iterator_concept = @\seebelow@;
|
5480 |
| - using iterator_category = @\seebelow@; |
| 5480 | + using iterator_category = @\seebelow@; // not always present |
5481 | 5481 | using value_type = iter_value_t<I>;
|
5482 | 5482 | using difference_type = iter_difference_t<I>;
|
5483 | 5483 | using pointer = @\seebelow@;
|
|
5489 | 5489 | \rSec3[common.iter.types]{Associated types}
|
5490 | 5490 |
|
5491 | 5491 | \pnum
|
5492 |
| -The nested \grammarterm{typedef-name}s of the specialization of |
5493 |
| -\tcode{iterator_traits} for \tcode{common_iterator<I, S>} are defined as follows. |
| 5492 | +The nested \grammarterm{typedef-name} \tcode{iterator_category} of |
| 5493 | +the specialization of \tcode{iterator_traits} for \tcode{common_iterator<I, S>} |
| 5494 | +is defined if and only if \tcode{iter_difference_t<I>} is an integral type. |
| 5495 | +In that case, |
| 5496 | +\tcode{iterator_category} denotes \tcode{forward_iterator_tag} if |
| 5497 | +the \grammarterm{qualified-id} \tcode{iterator_traits<I>::iterator_category} |
| 5498 | +is valid and denotes a type that |
| 5499 | +models \tcode{\libconcept{derived_from}<forward_iterator_tag>}; |
| 5500 | +otherwise it denotes \tcode{input_iterator_tag}. |
| 5501 | + |
| 5502 | +\pnum |
| 5503 | +The remaining nested \grammarterm{typedef-name}s of the specialization of |
| 5504 | +\tcode{iterator_traits} for \tcode{common_iterator<I, S>} are defined as follows: |
5494 | 5505 | \begin{itemize}
|
5495 | 5506 | \item
|
5496 | 5507 | \tcode{iterator_concept} denotes \tcode{forward_iterator_tag}
|
5497 | 5508 | if \tcode{I} models \libconcept{forward_iterator};
|
5498 | 5509 | otherwise it denotes \tcode{input_iterator_tag}.
|
5499 | 5510 |
|
5500 |
| -\item |
5501 |
| -\tcode{iterator_category} denotes |
5502 |
| -\tcode{forward_iterator_tag} |
5503 |
| -if the \grammarterm{qualified-id} \tcode{iterator_traits<I>::iter\-ator_category} |
5504 |
| -is valid and denotes a type that |
5505 |
| -models \tcode{\libconcept{derived_from}<forward_iterator_tag>}; |
5506 |
| -otherwise it denotes \tcode{input_iterator_tag}. |
5507 |
| - |
5508 | 5511 | \item
|
5509 | 5512 | Let \tcode{a} denote an lvalue of type \tcode{const common_iterator<I, S>}.
|
5510 | 5513 | If the expression \tcode{a.operator->()} is well-formed,
|
|
0 commit comments