//******************************************************** // 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 #include #include #include int main() { // print nested collections: std::vector> coll2d{{1, 1, 1}, {47, 11}, {0, 8, 15}}; std::println("coll2d: {}", coll2d); // print sub-views of three elements: std::vector coll{0, 8, 15, 47, 11, -1, 42}; std::println("chunked: {}", coll | std::views::chunk(3)); }