//********************************************************
// 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 <set>
#include <array>
#include <ranges>

int main()
{
  std::vector<int> coll{47, 11, 0, 8, 15, -11, 7};
  std::println("coll: {}", coll);

  auto set1 = std::ranges::to<std::set>(coll);
  std::println("set1: {}", set1);

  std::println("to(): {}", std::ranges::to<std::set>(coll));

  auto set2 = std::ranges::to<std::set<double>>(coll);
  std::println("set2: {::.2f}", set2);  // print doubles with precision of 2 digits 
}

