//******************************************************** // 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 int main() { std::vector coll{47, 11, 0, 8, 15, -11, 7}; std::println("coll: {}", coll); auto set1 = std::ranges::to(coll); std::println("set1: {}", set1); std::println("to(): {}", std::ranges::to(coll)); auto set2 = std::ranges::to>(coll); std::println("set2: {::.2f}", set2); // print doubles with precision of 2 digits }