C++ 23 · Containers and algorithms

View a contiguous range

A non-owning view over an array or vector (C++20).

void print_all(std::span<const int> values) {
    for (int n : values) std::cout << n << ' ';
}

Official C++ 23 documentation

More containers and algorithms commands

All containers and algorithms commands · C++ 23 cheatsheet

Was this page helpful?