Created on 2025-04-29.00:00:00 last changed 1 month ago
Proposed resolution:
This wording is relative to N5008.
Modify [const.iterators.iterator] as indicated:
namespace std {
[…]
template<input_iterator Iterator>
class basic_const_iterator {
Iterator current_ = Iterator(); // exposition only
using reference = iter_const_reference_t<Iterator>; // exposition only
using rvalue-reference = // exposition only
iter-const-rvalue-reference-t<Iterator>;
public:
using iterator_type = Iterator;
using iterator_concept = see below;
using iterator_category = see below; // not always present
using value_type = iter_value_t<Iterator>;
using difference_type = iter_difference_t<Iterator>;
[…]
};
}
[ Kona 2025-11-08; Status changed: Voting → WP. ]
[ 2025-06-12; Reflector poll ]
Set status to Tentatively Ready after eight votes in favour during reflector poll.
Currently, iterator adaptors in <iterator> that wrap a single iterator
such as `reverse_iterator`, `move_iterator`, and `counted_iterator` all provide a
public `iterator_type` member for users to access the underlying iterator type, except for
`basic_const_iterator` (demo):
#include <iterator>
using I = int*;
using RI = std::reverse_iterator<I>;
using MI = std::move_iterator<I>;
using CI = std::counted_iterator<I>;
using BI = std::basic_const_iterator<I>;
static_assert(std::same_as<RI::iterator_type, I>);
static_assert(std::same_as<MI::iterator_type, I>);
static_assert(std::same_as<CI::iterator_type, I>);
static_assert(std::same_as<BI::iterator_type, I>); // error
It seems reasonable to add one for `basic_const_iterator` for consistency.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2025-11-11 10:48:16 | admin | set | messages: + msg15617 |
| 2025-11-11 10:48:16 | admin | set | status: voting -> wp |
| 2025-10-30 17:45:31 | admin | set | status: ready -> voting |
| 2025-06-12 21:01:31 | admin | set | messages: + msg14806 |
| 2025-06-12 21:01:31 | admin | set | status: new -> ready |
| 2025-05-04 12:04:34 | admin | set | messages: + msg14744 |
| 2025-04-29 00:00:00 | admin | create | |