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 << ' ';
}
C++ 23 · Containers and algorithms
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 << ' ';
}
Was this page helpful?