When using the C++20 format library to format text into a buffer:
- without relying on std::vector and std::back_inserter
- without truncating the output using std::format_to_n
We have to first calculate the length of the formatted text using std::formatted_size.
Compiler Explorer link: https://compiler-explorer.com/z/1dqee1qKz