I learned recently about std::format. It is the true modern replacement to printf(). The current codebase has printf() along with some printf()-style custom functions like util::clean_assert() and util::Exception(). These should be replaced.
Note that std::format is a c++20 feature that is at this moment not supported by the latest gcc version (gcc12). When gcc13 advertises std::format support [source].
This humorous blog post clearly demonstrates why std::format is superior to both printf() and std::cout <<.
I learned recently about
std::format
. It is the true modern replacement toprintf()
. The current codebase hasprintf()
along with someprintf()
-style custom functions likeutil::clean_assert()
andutil::Exception()
. These should be replaced.Note that
std::format
is a c++20 feature that is at this moment not supported by the latest gcc version (gcc12). When gcc13 advertisesstd::format
support [source].This humorous blog post clearly demonstrates why
std::format
is superior to bothprintf()
andstd::cout <<
.