//********************************************************
// The following code example is taken from the book
//  C++23 - The Complete Guide
//  by Nicolai M. Josuttis (www.josuttis.com)
//  https://www.cppstd23.com
//
// The code is licensed under a
//  Creative Commons Attribution 4.0 International License
//  https://creativecommons.org/licenses/by/4.0/
//********************************************************


#include <print>
#include <flat_set>
#include <ranges>
#include <span>
#include "fibo3.hpp"  // coroutine for the first n Fibonacci numbers

int main()
{
  std::flat_set<std::string> names{"tic", "tac", "toe"};
  std::println("flat 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 3:   {}", sp.last(3));                     // span

  std::generator<long> fibo = fibonacci(12);                    // coroutine interface
  std::println("fibo:     {}", fibo);
}

