Let's start by compiling and running this code. For instance: https://godbolt.org/ Code compiles and output is: Case A: 3 Case B: 1 Case C: 150589 The result of Case C is not guaranteed, as we will discuss later. According to the documentation std::mdspan is non-owning multi-dimensional array view that maps a multi-dimensional index to an element of the underlying storage. Since std::mdspan is non-owning, one needs to be careful with lifetime of the data that is accessed via std::mdspan . operator[] doesn't perform bounds checking of the array, leaving all responsibility to the programmer. C++26 introduces a new member function, at() , which performs bounds check but not everyone has the luxury to jump to the latest C++ version. std::mdspan is only a view representing the data so it doesn't change or rearrange data itself. Interface provides some flexibity in configuring layout for the data. Most basic would be std::layout_left an...