Skip to content

Commit 4c8221e

Browse files
TylerMSFTTylerMSFT
authored andcommitted
match incoming changes
1 parent 83b770e commit 4c8221e

1 file changed

Lines changed: 42 additions & 41 deletions

File tree

docs/standard-library/iterator-functions.md

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ description: "Learn more about: <iterator> functions"
33
title: "<iterator> functions"
44
ms.date: "11/04/2016"
55
f1_keywords: ["xutility/std::advance", "xutility/std::back_inserter", "xutility/std::begin", "xutility/std::cbegin", "xutility/std::cend", "xutility/std::distance", "xutility/std::end", "xutility/std::front_inserter", "xutility/std::inserter", "xutility/std::make_checked_array_iterator", "xutility/std::make_move_iterator", "xutility/std::make_unchecked_array_iterator", "xutility/std::next", "xutility/std::prev"]
6-
ms.assetid: 4a57c9a3-7e36-411f-8655-e0be2eec88e7
76
helpviewer_keywords: ["std::advance [C++]", "std::back_inserter [C++]", "std::begin [C++]", "std::cbegin [C++]", "std::cend [C++]", "std::distance [C++]", "std::end [C++]", "std::front_inserter [C++]", "std::inserter [C++]", "std::make_checked_array_iterator [C++]", "std::make_move_iterator [C++]", "std::make_unchecked_array_iterator [C++]", "std::next [C++]", "std::prev [C++]"]
87
---
98
# `<iterator>` functions
109

11-
## <a name="advance"></a> advance
10+
## <a name="advance"></a> `advance`
1211

1312
Increments an iterator by a specified number of positions.
1413

@@ -19,17 +18,17 @@ void advance(InputIterator& InIt, Distance Off);
1918
2019
### Parameters
2120
22-
*InIt*\
21+
*`InIt`*\
2322
The iterator that is to be incremented and that must satisfy the requirements for an input iterator.
2423
25-
*Off*\
24+
*`Off`*\
2625
An integral type that is convertible to the iterator's difference type and that specifies the number of increments the position of the iterator is to be advanced.
2726
2827
### Remarks
2928
3029
The range must be nonsingular, where the iterators must be dereferenceable or past the end.
3130
32-
If the `InputIterator` satisfies the requirements for a bidirectional iterator type, then *Off* may be negative. If `InputIterator` is an input or forward iterator type, *Off* must be nonnegative.
31+
If the `InputIterator` satisfies the requirements for a bidirectional iterator type, then *Off* may be negative. If `InputIterator` is an input or forward iterator type, *`Off`* must be nonnegative.
3332
3433
The advance function has constant complexity when `InputIterator` satisfies the requirements for a random-access iterator; otherwise, it has linear complexity and so is potentially expensive.
3534
@@ -81,27 +80,27 @@ LPOS is advanced 4 steps forward to point to the fifth element: 5.
8180
LPOS is moved 3 steps back to point to the 2nd element: 2.
8281
```
8382

84-
## <a name="back_inserter"></a> back_inserter
83+
## <a name="back_inserter"></a> `back_inserter`
8584

8685
Creates an iterator that can insert elements at the back of a specified container.
8786

8887
```cpp
8988
template <class Container>
90-
back_insert_iterator<Container> back_inserter(Container& _Cont);
89+
back_insert_iterator<Container> back_inserter(Container& Cont);
9190
```
9291
9392
### Parameters
9493
95-
*_Cont*\
94+
*`Cont`*\
9695
The container into which the back insertion is to be executed.
9796
9897
### Return Value
9998
100-
A `back_insert_iterator` associated with the container object *_Cont*.
99+
A `back_insert_iterator` associated with the container object *`Cont`*.
101100
102101
### Remarks
103102
104-
Within the C++ Standard Library, the argument must refer to one of the three sequence containers that have the member function `push_back`: [deque Class](../standard-library/deque-class.md), [list Class](../standard-library/list-class.md), or [vector Class](../standard-library/vector-class.md).
103+
Within the C++ Standard Library, the argument must refer to one of the three sequence containers that have the member function `push_back`: [`deque` Class](../standard-library/deque-class.md), [`list` Class](../standard-library/list-class.md), or [`vector` Class](../standard-library/vector-class.md).
105104
106105
### Example
107106
@@ -154,7 +153,7 @@ The initial vector vec is: ( 0 1 2 ).
154153
After the insertions, the vector vec is: ( 0 1 2 30 40 500 600 ).
155154
```
156155

157-
## <a name="begin"></a> begin
156+
## <a name="begin"></a> `begin`
158157

159158
Retrieves an iterator to the first element in a specified container.
160159

@@ -173,17 +172,17 @@ Ty *begin(Ty (& array)[Size]);
173172
174173
### Parameters
175174
176-
*cont*\
175+
*`cont`*\
177176
A container.
178177
179-
*array*\
178+
*`array`*\
180179
An array of objects of type `Ty`.
181180
182181
### Return Value
183182
184183
The first two template functions return `cont.begin()`. The first function is non-constant; the second one is constant.
185184
186-
The third template function returns *array*.
185+
The third template function returns *`array`*.
187186
188187
### Example
189188
@@ -256,7 +255,7 @@ Then sending an array to it would cause this compiler error:
256255
error C2228: left of '.begin' must have class/struct/union
257256
```
258257

259-
## <a name="cbegin"></a> cbegin
258+
## <a name="cbegin"></a> `cbegin`
260259

261260
Retrieves a const (read-only) iterator to the first element in a specified container.
262261

@@ -268,7 +267,7 @@ auto cbegin(const Container& cont)
268267
269268
### Parameters
270269
271-
*cont*\
270+
*`cont`*\
272271
A container or initializer_list.
273272
274273
### Return Value
@@ -289,7 +288,7 @@ auto i2 = Container.cbegin();
289288
// i2 is Container<T>::const_iterator
290289
```
291290

292-
## <a name="cend"></a> cend
291+
## <a name="cend"></a> `cend`
293292

294293
Retrieves a const (read-only) iterator to the element that follows the last element in the specified container.
295294

@@ -301,8 +300,8 @@ auto cend(const Container& cont)
301300
302301
### Parameters
303302
304-
*cont*\
305-
A container or initializer_list.
303+
*`cont`*\
304+
A container or `initializer_list`.
306305
307306
### Return Value
308307
@@ -322,15 +321,15 @@ auto i2 = Container.cend();
322321
// i2 is Container<T>::const_iterator
323322
```
324323

325-
## <a name="crbegin"></a> crbegin
324+
## <a name="crbegin"></a> `crbegin`
326325

327326
Get a reverse read-only iterator to the elements of the container, starting at the end of the container.
328327

329328
```cpp
330329
template <class C> constexpr auto crbegin(const C& c) -> decltype(std::rbegin(c));
331330
```
332331
333-
## <a name="crend"></a> crend
332+
## Parameters
334333
335334
*`C`*\
336335
The type of the container.
@@ -373,7 +372,7 @@ Get the sentinel at the end of a read-only reversed sequence of elements.
373372
template <class C> constexpr auto crend(const C& c) -> decltype(std::rend(c));
374373
```
375374
376-
## <a name="data"></a> data
375+
## Parameters
377376
378377
*`C`*\
379378
The type of the container.
@@ -403,7 +402,9 @@ int main()
403402
}
404403
```
405404

406-
## <a name="distance"></a> distance
405+
```output
406+
10
407+
```
407408

408409
## <a name="data"></a> `data`
409410

@@ -476,15 +477,15 @@ typename iterator_traits<InputIterator>::difference_type distance(InputIterator
476477
477478
### Parameters
478479
479-
*first*\
480+
*`first`*\
480481
The first iterator whose distance from the second is to be determined.
481482
482-
*last*\
483+
*`last`*\
483484
The second iterator whose distance from the first is to be determined.
484485
485486
### Return Value
486487
487-
The number of times that *first* must be incremented until it equal *last*.
488+
The number of times that *`first`* must be incremented until it equals *`last`*.
488489
489490
### Remarks
490491
@@ -539,15 +540,15 @@ LPOS is advanced 7 steps forward to point to the eighth element: 12.
539540
The distance from L.begin( ) to LPOS is: 7.
540541
```
541542

542-
## <a name="empty"></a> empty
543+
## <a name="empty"></a> `empty`
543544

544545
```cpp
545546
template <class C> constexpr auto empty(const C& c) -> decltype(c.empty());
546547
template <class T, size_t N> constexpr bool empty(const T (&array)[N]) noexcept;
547548
template <class E> constexpr bool empty(initializer_list<E> il) noexcept;
548549
```
549550
550-
## <a name="end"></a> end
551+
## Parameters
551552
552553
*`C`*\
553554
The type of the container.
@@ -610,10 +611,10 @@ Ty *end(Ty (& array)[Size]);
610611
611612
### Parameters
612613
613-
*cont*\
614+
*`cont`*\
614615
A container.
615616
616-
*array*\
617+
*`array`*\
617618
An array of objects of type `Ty`.
618619
619620
### Return Value
@@ -624,25 +625,25 @@ The third template function returns `array + Size`.
624625
625626
### Remarks
626627
627-
For a code example, see [begin](../standard-library/iterator-functions.md#begin).
628+
For a code example, see [`begin`](../standard-library/iterator-functions.md#begin).
628629
629-
## <a name="front_inserter"></a> front_inserter
630+
## <a name="front_inserter"></a> `front_inserter`
630631
631632
Creates an iterator that can insert elements at the front of a specified container.
632633
633634
```cpp
634635
template <class Container>
635-
front_insert_iterator<Container> front_inserter(Container& _Cont);
636+
front_insert_iterator<Container> front_inserter(Container& Cont);
636637
```
637638

638639
### Parameters
639640

640-
*_Cont*\
641+
*`Cont`*\
641642
The container object whose front is having an element inserted.
642643

643644
### Return Value
644645

645-
A `front_insert_iterator` associated with the container object *_Cont*.
646+
A `front_insert_iterator` associated with the container object *`Cont`*.
646647

647648
### Remarks
648649

@@ -701,27 +702,27 @@ After the front insertions, the list L is:
701702

702703
## <a name="inserter"></a> inserter
703704

704-
A helper template function that lets you use `inserter(_Cont, _Where)` instead of `insert_iterator<Container>(_Cont, _Where)`.
705+
A helper template function that lets you use `inserter(Cont, Where)` instead of `insert_iterator<Container>(Cont, Where)`.
705706

706707
```cpp
707708
template <class Container>
708709
insert_iterator<Container>
709710
inserter(
710-
Container& _Cont,
711-
typename Container::iterator _Where);
711+
Container& Cont,
712+
typename Container::iterator Where);
712713
```
713714
714715
### Parameters
715716
716-
*_Cont*\
717+
*`Cont`*\
717718
The container to which new elements are to be added.
718719
719-
*_Where*\
720+
*Where*\
720721
An iterator locating the point of insertion.
721722
722723
### Remarks
723724
724-
The template function returns [insert_iterator](../standard-library/insert-iterator-class.md#insert_iterator)`<Container>(_Cont, _Where)`.
725+
The template function returns [insert_iterator](../standard-library/insert-iterator-class.md#insert_iterator)`<Container>(Cont, Where)`.
725726
726727
### Example
727728

0 commit comments

Comments
 (0)