//********************************************************
// 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 <print>
#include <vector>
#include <list>
#include <set>
#include <ranges>

int main()
{
  std::list data{47, 11, 42, 0, 8, 15};

  std::vector coll1{std::from_range, data};
  std::println("coll1: {}", coll1);

  std::set coll2{std::from_range, data};
  std::println("coll2: {}", coll2);

  std::vector coll3{std::from_range, std::views::iota(1, 11)};
  std::println("coll3: {}", coll3);
}

