A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.tutorialspoint.com/cpp_standard_library/iterator.htm below:

C++ Standard Library Iterators

C++ Library - <iterator> Introduction

It is a pointer-like object that can be incremented with ++, dereferenced with *, and compared against another iterator with !=

Categories category properties valid expressions all categories copy-constructible, copy-assignable and destructible

X b(a);

b = a;

It can be incremented

++a

a++

Random Access Bidirectional Forward Input It supports equality/inequality comparisons

a == b

a != b

It can be dereferenced as an rvalue

*a

a->m

Output

It can be dereferenced as an lvalue

(only for mutable iterator types)

*a = t

*a++ = t

default-constructible

X a;

X()

Multi-pass: neither dereferencing nor incrementing affects dereferenceability { b = a; *a++; *b; } It can be decremented

--a

a--

*a--

It supports arithmetic operators + and -

a + n

n + a

a - n

a - b

It supports inequality comparisons ( <, >, <= and >=) between iterators

a < b

a > b

a <= b

a >= b

It supports compound assignment operations += and -=

a += n

a -= n

It supports offset dereference operator ([]) a[n] Functions Sr.No. Functions & Description 1 advance

It advances the iterator it by n element positions.

2 distance

It returns distance between iterators.

3 begin

It is used to begin an iterator.

4 end

It is used to end an iterator.

5 prev

It is used to get iterator to previous element.

6 next

It is used to get iterator to next element.

Iterator generators Classes Predefined iterators Category tags

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4