11.2.0
-
Added the
sspecifier forstd::error_code. It allows formatting an error message as a string. For example:#include <fmt/std.h> int main() { auto ec = std::make_error_code(std::errc::no_such_file_or_directory); fmt::print("{:s}\n", ec); }prints
No such file or directory(The actual message is platform-specific.)
-
Fixed formatting of
std::chrono::local_timeandtm(https://github.com/fmtlib/fmt/issues/3815, https://github.com/fmtlib/fmt/issues/4350). For example (godbolt):#include <fmt/chrono.h> int main() { std::chrono::zoned_time zt( std::chrono::current_zone(), std::chrono::system_clock::now()); fmt::print("{}", zt.get_local_time()); }is now formatted consistenly across platforms.
-
Added diagnostics for cases when timezone information is not available. For example:
fmt::print("{:Z}", std::chrono::local_seconds());now gives a compile-time error.
-
Deprecated
fmt::localtimein favor ofstd::localtime. -
Fixed compilation with GCC 15 and C++20 modules enabled (https://github.com/fmtlib/fmt/pull/4347). Thanks @tkhyn.
-
Fixed handling of named arguments in format specs (https://github.com/fmtlib/fmt/issues/4360, https://github.com/fmtlib/fmt/pull/4361). Thanks @dinomight.
-
Added error reporting for duplicate named arguments (https://github.com/fmtlib/fmt/pull/4367). Thanks @dinomight.
-
Fixed formatting of
longwithFMT_BUILTIN_TYPES=0(https://github.com/fmtlib/fmt/issues/4375, https://github.com/fmtlib/fmt/issues/4394). -
Optimized
text_styleusing bit packing (https://github.com/fmtlib/fmt/pull/4363). Thanks @LocalSpook. -
Added support for incomplete types (https://github.com/fmtlib/fmt/issues/3180, https://github.com/fmtlib/fmt/pull/4383). Thanks @LocalSpook.
-
Fixed a flush issue in
fmt::printwhen using libstdc++ (https://github.com/fmtlib/fmt/issues/4398). -
Fixed
fmt::printlnusage withFMT_ENFORCE_COMPILE_STRINGand legacy compile-time checks (https://github.com/fmtlib/fmt/pull/4407). Thanks @madmaxoft. -
Removed legacy header
fmt/core.hfrom docs (https://github.com/fmtlib/fmt/pull/4421, https://github.com/fmtlib/fmt/pull/4422). Thanks @krzysztofkortas. -
Worked around limitations of
__builtin_strlenduring constant evaluation (https://github.com/fmtlib/fmt/issues/4423, https://github.com/fmtlib/fmt/pull/4429). Thanks @BRevzin. -
Worked around a bug in MSVC v141 (https://github.com/fmtlib/fmt/issues/4412, https://github.com/fmtlib/fmt/pull/4413). Thanks @hirohira9119.
-
Removed the
fmt_detailnamespace (https://github.com/fmtlib/fmt/issues/4324). -
Removed specializations of
std::is_floating_pointin tests (https://github.com/fmtlib/fmt/issues/4417). -
Fixed a CMake error when setting
CMAKE_MODULE_PATHin the pedantic mode (https://github.com/fmtlib/fmt/pull/4426). Thanks @rlalik. -
Updated the Bazel config (https://github.com/fmtlib/fmt/pull/4400). Thanks @Vertexwahn.