Skip to content

11.2.0

Latest
Compare
Choose a tag to compare
@vitaut vitaut released this 03 May 16:40
  • Added the s specifier for std::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_time and tm (#3815, #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::localtime in favor of std::localtime.

  • Fixed compilation with GCC 15 and C++20 modules enabled (#4347). Thanks @tkhyn.

  • Fixed handling of named arguments in format specs (#4360, #4361). Thanks @dinomight.

  • Added error reporting for duplicate named arguments (#4367). Thanks @dinomight.

  • Fixed formatting of long with FMT_BUILTIN_TYPES=0 (#4375, #4394).

  • Optimized text_style using bit packing (#4363). Thanks @localspook.

  • Added support for incomplete types (#3180, #4383). Thanks @localspook.

  • Fixed a flush issue in fmt::print when using libstdc++ (#4398).

  • Fixed fmt::println usage with FMT_ENFORCE_COMPILE_STRING and legacy compile-time checks (#4407). Thanks @madmaxoft.

  • Removed legacy header fmt/core.h from docs (#4421, #4422). Thanks @krzysztofkortas.

  • Worked around limitations of __builtin_strlen during constant evaluation (#4423, #4429). Thanks @brevzin.

  • Worked around a bug in MSVC v141 (#4412, #4413). Thanks @hirohira9119.

  • Removed the fmt_detail namespace (#4324).

  • Removed specializations of std::is_floating_point in tests (#4417).

  • Fixed a CMake error when setting CMAKE_MODULE_PATH in the pedantic mode (#4426). Thanks @rlalik.

  • Updated the Bazel config (#4400). Thanks @Vertexwahn.