Summary
This episode explores C++23's powerful new range formatting capabilities, which enable easy printing of various container types and nested data structures. Jason demonstrates how to use std::format and std::print to output pairs, tuples, vectors, and even complex nested structures like maps containing pairs and other containers. He shows how format specifiers can modify output presentation, such as using {:m} for map-style pair formatting or removing delimiters, and illustrates the library's ability to handle arbitrarily nested container types at compile time. The episode highlights how these features bring C++ closer to having built-in serialization capabilities similar to JSON.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[format.functions]40% match -
[map]40% match -
[print.fun]40% match