Intermediate C++
Q77 / 100

What is the std::span type?

Correct! Well done.

Incorrect.

The correct answer is B) A non-owning view over a contiguous sequence of objects, providing a unified interface for arrays, vectors, and C arrays

B

Correct Answer

A non-owning view over a contiguous sequence of objects, providing a unified interface for arrays, vectors, and C arrays

Explanation

std::span<T> (C++20) is like std::string_view but for any contiguous range. Passing span<int> accepts int[], vector<int>, and array<int,N>.

Progress
77/100