//******************************************************** // 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 #include "fibo3.hpp" // coroutine for the first n Fibonacci numbers int main() { std::set names{"tic", "tac", "toe"}; std::println("set: {}", names); // set std::println("tuples: {}", names | std::views::enumerate); // view of tuples int arr[] = {0, 8, 15, 47, 11, -1, 42}; std::println("array: {}", arr); // raw array std::span sp{arr}; std::println("last: {}", sp.last(3)); // span std::generator fibo = fibonacci(12); // coroutine interface std::println("fibo: {}", fibo); }