...

/

Predefined Concepts - Part II

Predefined Concepts - Part II

Get an overview of important predefined concepts of C++20.

A vector supports a random_access_iterator. A random_access_iterator is also a bidirectional_iterator. Hence a std::vector also supports a bidirectional_iterator.

General utilities library

Note: The “General utilities library” chapter in the standard has only special memory concepts; therefore, I don’t refer to them here.

Iterators library

The iterators library has many important concepts. They are defined in the <iterator> header. Here are the iterator categories:

  • input_iterator
  • output_iterator
  • forward_iterator
  • bidirectional_iterator
  • random_access_iterator
  • contiguous_iterator

The six categories of iterators correspond to the respective iterator concepts. The table below provides two interesting pieces of information. For the three most prominent iterator categories, the table shows their properties and the associated standard library containers.

Iterator Category Properties Containers
...