|
335 | 335 | inserter(Container& x, ranges::iterator_t<Container> i); // freestanding
|
336 | 336 |
|
337 | 337 | // \ref{const.iterators}, constant iterators and sentinels
|
| 338 | + // \ref{const.iterators.alias}, alias templates |
338 | 339 | template<@\libconcept{indirectly_readable}@ I>
|
339 | 340 | using iter_const_reference_t = @\seebelow@; // freestanding
|
340 | 341 | template<class Iterator>
|
341 | 342 | concept @\exposconcept{constant-iterator}@ = @\seebelow@; // \expos
|
| 343 | + template<@\libconcept{input_iterator}@ I> |
| 344 | + using const_iterator = @\seebelow@; // freestanding |
| 345 | + template<class S> |
| 346 | + using const_sentinel = @\seebelow@; // freestanding |
342 | 347 |
|
| 348 | + // \ref{const.iterators.iterator}, class template \tcode{basic_const_iterator} |
343 | 349 | template<class Iterator>
|
344 | 350 | class basic_const_iterator; // freestanding
|
345 | 351 |
|
|
356 | 362 | using type = basic_const_iterator<common_type_t<T, U>>;
|
357 | 363 | };
|
358 | 364 |
|
359 |
| - template<@\libconcept{input_iterator}@ I> |
360 |
| - using const_iterator = @\seebelow@; // freestanding |
361 |
| - |
362 |
| - template<class S> |
363 |
| - using const_sentinel = @\seebelow@; // freestanding |
364 |
| - |
365 | 365 | template<@\libconcept{input_iterator}@ I>
|
366 | 366 | constexpr const_iterator<I> make_const_iterator(I it) { return it; } // freestanding
|
367 | 367 |
|
|
4157 | 4157 |
|
4158 | 4158 | \rSec2[const.iterators]{Constant iterators and sentinels}
|
4159 | 4159 |
|
| 4160 | +\rSec3[const.iterators.general]{General} |
| 4161 | + |
4160 | 4162 | \pnum
|
4161 | 4163 | Class template \tcode{basic_const_iterator} is an iterator adaptor
|
4162 | 4164 | with the same behavior as the underlying iterator
|
|
4169 | 4171 | \pnum
|
4170 | 4172 | Specializations of \tcode{basic_const_iterator} are constant iterators.
|
4171 | 4173 |
|
| 4174 | +\rSec3[const.iterators.alias]{Alias templates} |
| 4175 | + |
4172 | 4176 | \begin{itemdecl}
|
4173 | 4177 | template<@\libconcept{indirectly_readable}@ It>
|
4174 | 4178 | using iter_const_reference_t = common_reference_t<const iter_value_t<It>&&,
|
|
4201 | 4205 | Otherwise, \tcode{S}.
|
4202 | 4206 | \end{itemdescr}
|
4203 | 4207 |
|
4204 |
| -\begin{codeblock} |
4205 |
| -template<class I> |
4206 |
| - concept @\exposconcept{not-a-const-iterator}@ = @\seebelow@; |
| 4208 | +\rSec3[const.iterators.iterator]{Class template \tcode{basic_const_iterator}} |
4207 | 4209 |
|
| 4210 | +\begin{codeblock} |
4208 | 4211 | namespace std {
|
| 4212 | + template<class I> |
| 4213 | + concept @\exposconcept{not-a-const-iterator}@ = @\seebelow@; |
| 4214 | + |
4209 | 4215 | template<@\libconcept{input_iterator}@ Iterator>
|
4210 | 4216 | class @\libglobal{basic_const_iterator}@ {
|
4211 | 4217 | Iterator @\exposid{current_}@ = Iterator();
|
|
4318 | 4324 | if \tcode{I} is a specialization of \tcode{basic_const_iterator} and
|
4319 | 4325 | \tcode{true} otherwise.
|
4320 | 4326 |
|
| 4327 | +\rSec3[const.iterators.types]{Member types} |
| 4328 | + |
4321 | 4329 | \pnum
|
4322 | 4330 | \tcode{basic_const_iterator<Iterator>::iterator_concept} is defined as follows:
|
4323 | 4331 | \begin{itemize}
|
|
4344 | 4352 | \tcode{basic_const_iterator<Iterator>::iterator_category} denotes
|
4345 | 4353 | the type \tcode{iterator_traits<\brk{}Iterator>::iterator_category}.
|
4346 | 4354 |
|
| 4355 | +\rSec3[const.iterators.ops]{Operations} |
| 4356 | + |
4347 | 4357 | \indexlibraryctor{basic_const_iterator}%
|
4348 | 4358 | \begin{itemdecl}
|
4349 | 4359 | constexpr basic_const_iterator(Iterator current);
|
|
0 commit comments