top | item 45254638

(no title)

merlincorey | 5 months 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

[2] https://en.cppreference.com/w/cpp/io/print.html

discuss

order

amomchilov|5 months ago

This 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

hoten|5 months ago

Is 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|5 months ago

From GCC 13, and clang 17. (2023).

Unfortunately, MSVC, always lags and fails to implement some things.

pton_xd|5 months ago

std::print / std::format also bloat the binary size, which is a consideration for some platforms (eg WASM).