3 ms·
There's a section on "why not printf" which is Standard C, but I can't find any section on "why not std::format"[1] which is Standard C++ since C++20 and works
by merlincorey 1y ago
There's a section on "why not printf" which is Standard C, but I can't find any section on "why not std::format"[1] which is Standard C++ since C++20 and works on all major compilers today in 2025.
They do mention "std::print"[2] from C++23 (which uses std::format) and compile times, but, they don't touch on "std::format" at all.
See:
[1] https://en.cppreference.com/w/cpp/utility/format/format.html https://en.cppreference.com/w/cpp/utility/format/format.html
[2] https://en.cppreference.com/w/cpp/io/print.html https://en.cppreference.com/w/cpp/io/print.html
- hoten 1y agoIs it in major compilers yet? Last I checked for MSVC it was behind a "latest" compiler flag (not C++20). I've been vendoring the fmt library for awhile now.
- shakna 1y agoFrom GCC 13, and clang 17. (2023). Unfortunately, MSVC, always lags and fails to implement some things.
- deleted 1y ago[deleted]
- pton_xd 1y agostd::print / std::format also bloat the binary size, which is a consideration for some platforms (eg WASM).
- amomchilov 1y agoThis is the eternal selection pressure that slows new C++ adoption. The kinds of places still waiting C++ aren’t usually the ones that put much emphasis on using a compiler from the past decade. Java 8 and C++98 will be here forever lol