//******************************************************** // The following code example is taken from the book // C++23 - The Complete Guide // by Nicolai M. Josuttis (www.josuttis.com) // http://www.cppstd23.com // // The code is licensed under a // Creative Commons Attribution 4.0 International License // http://creativecommons.org/licenses/by/4.0/ //******************************************************** #include void print2D(const auto& mds) { std::print("mdspan of {} rows:\n ", mds.extent(0)); for (std::size_t i=0; i != mds.extent(0); i++) { for (std::size_t j=0; j != mds.extent(1); j++) { std::print("{} ", mds[i, j]); } std::print("\n "); } std::print("\n"); }