liveBook · Manning

Ranges API

The C++ ranges API is a standard-library facility providing ranges, views, adaptors, and algorithms for processing sequences without explicit iterator pairs.

How 2 Manning books explain it

Learn C++ by Example

<ranges> is the C++ standard library header that declares ranges, views, and range adaptors.

How it is used
Uses views and adaptors to filter or transform containers while avoiding manual iterator tracking.
How deep it goes
Demonstrates drop_while, filter, pipe chaining, and validation, but does not develop adaptor internals.
Examples
Shows vector filtering, dropping values below three, checking nonnegative rows, and comparing iterator-based removal.
What you can do after
Apply it via std::views to compose readable filtering and skipping operations over containers.

Read how Learn C++ by Example explains ranges API →

100 C++ Mistakes and How to Avoid Them

The C++ ranges API is a standard-library interface for applying algorithms to ranges of elements without requiring explicit iterator pairs.

How it is used
Simplifies container processing by composing transformations and predicates without requiring explicit iterator pairs.
How deep it goes
Explains mapping, filtering, and reduction, and demonstrates a composed transform-and-filter pipeline.
Examples
Demonstrates transforming integers to absolute values, filtering evens, and accumulating their sum.
What you can do after
Apply C++ ranges and views to compose value transformations and filters before accumulation.

Read how 100 C++ Mistakes and How to Avoid Them explains ranges API →

Related concepts

Questions about ranges API

What is ranges API?

The C++ ranges API is a standard-library facility providing ranges, views, adaptors, and algorithms for processing sequences without explicit iterator pairs.

Which Manning books explain ranges API?

Learn C++ by Example and 100 C++ Mistakes and How to Avoid Them.

What is the difference between ranges API and std::accumulate?

The C++ ranges API is a standard-library facility providing ranges, views, adaptors, and algorithms for processing sequences without explicit iterator pairs. std::accumulate is a C++ standard-library algorithm that combines the elements of a range into a result using an initial value and an accumulation operation.

What are the parts of ranges API?

Ranges API includes std::views::zip.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.