Skip to content

Releases: fmtlib/fmt

7.0.1

07 Jul 15:33
Compare
Choose a tag to compare
  • Updated the inline version namespace name.

  • Worked around a gcc bug in mangling of alias templates (#1753).

  • Fixed a linkage error on Windows (#1757). Thanks @Kurkin (Dmitry Kurkin).

  • Fixed minor issues with the documentation.

7.0.0

06 Jul 13:17
Compare
Choose a tag to compare

6.2.1

09 May 16:54
Compare
Choose a tag to compare
  • Fixed ostream support in sprintf (#1631).

  • Fixed type detection when using implicit conversion to string_view and ostream operator<< inconsistently (#1662).

6.2.0

06 Apr 13:13
Compare
Choose a tag to compare

6.1.2

11 Dec 16:25
Compare
Choose a tag to compare

6.1.1

05 Dec 15:15
Compare
Choose a tag to compare

6.1.0

02 Dec 14:15
Compare
Choose a tag to compare

6.0.0

26 Aug 13:59
Compare
Choose a tag to compare
Read more

5.3.0

28 Dec 20:36
Compare
Choose a tag to compare
  • Introduced experimental chrono formatting support:

    #include <fmt/chrono.h>
    
    int main() {
      using namespace std::literals::chrono_literals;
      fmt::print("Default format: {} {}\n", 42s, 100ms);
      fmt::print("strftime-like format: {:%H:%M:%S}\n", 3h + 15min + 30s);
    }

    prints:

    Default format: 42s 100ms
    strftime-like format: 03:15:30
    
  • Added experimental support for emphasis (bold, italic, underline, strikethrough), colored output to a file stream, and improved colored formatting API (#961, #967, #973):

    #include <fmt/color.h>
    
    int main() {
      print(fg(fmt::color::crimson) | fmt::emphasis::bold,
            "Hello, {}!\n", "world");
      print(fg(fmt::color::floral_white) | bg(fmt::color::slate_gray) |
            fmt::emphasis::underline, "Hello, {}!\n", "мир");
      print(fg(fmt::color::steel_blue) | fmt::emphasis::italic,
            "Hello, {}!\n", "世界");
    }

    prints the following on modern terminals with RGB color support:

    Thanks @Rakete1111 (Nicolas).

  • Added support for 4-bit terminal colors (#968, #974)

    #include <fmt/color.h>
    
    int main() {
      print(fg(fmt::terminal_color::red), "stop\n");
    }

    Note that these colors vary by terminal:Thanks @Rakete1111 (Nicolas).

  • Parameterized formatting functions on the type of the format string (#880, #881, #883, #885, #897, #920). Any object of type S that has an overloaded to_string_view(const S&) returning fmt::string_view can be used as a format string:

    namespace my_ns {
    inline string_view to_string_view(const my_string& s) {
      return {s.data(), s.length()};
    }
    }
    
    std::string message = fmt::format(my_string("The answer is {}."), 42);

    Thanks @DanielaE (Daniela Engert).

  • Made std::string_view work as a format string (#898):

    auto message = fmt::format(std::string_view("The answer is {}."), 42);

    Thanks @DanielaE (Daniela Engert).

  • Added wide string support to compile-time format string checks (#924):

    print(fmt(L"{:f}"), 42); // compile-time error: invalid type specifier

    Thanks @XZiar.

  • Made colored print functions work with wide strings (#867):

    #include <fmt/color.h>
    
    int main() {
      print(fg(fmt::color::red), L"{}\n", 42);
    }

    Thanks @DanielaE (Daniela Engert).

  • Introduced experimental Unicode support (#628, #891):

    using namespace fmt::literals;
    auto s = fmt::format("{:*^5}"_u, "🤡"_u); // s == "**🤡**"_u
  • Improved locale support:

    #include <fmt/locale.h>
    
    struct numpunct : std::numpunct<char> {
     protected:
      char do_thousands_sep() const override { return '~'; }
    };
    
    std::locale loc;
    auto s = fmt::format(std::locale(loc, new numpunct()), "{:n}", 1234567);
    // s == "1~234~567"
  • Constrained formatting functions on proper iterator types (#921). Thanks @DanielaE (Daniela Engert).

  • Added make_printf_args and make_wprintf_args functions (#934). Thanks @tnovotny.

  • Deprecated fmt::visit, parse_context, and wparse_context. Use fmt::visit_format_arg, format_parse_context, and wformat_parse_context instead.

  • Removed undocumented basic_fixed_buffer which has been superseded by the iterator-based API (#873, #902). Thanks @superfunc (hollywood programmer).

  • Disallowed repeated leading zeros in an argument ID:

    fmt::print("{000}", 42); // error
  • Reintroduced support for gcc 4.4.

  • Fixed compilation on platforms with exotic double (#878).

  • Improved documentation (#164, #877, #901, #906, #979). Thanks @kookjr (Mathew Cucuzella), @DarkDimius (Dmitry Petrashko), @HecticSerenity.

  • Added pkgconfig support which makes it easier to consume the library from meson and other build systems (#916). Thanks @colemickens (Cole Mickens).

  • Various build improvements (#909, #926, #937, #953, #959). Thanks @tchaikov (Kefu Chai), @luncliff (Park DongHa), @AndreasSchoenle (Andreas Schönle), @hotwatermorning, @Zefz (JohanJansen).

  • Improved string_view construction performance (#914). Thanks @gabime (Gabi Melman).

  • Fixed non-matching char types (#895). Thanks @DanielaE (Daniela Engert).

  • Fixed format_to_n with std::back_insert_iterator (#913). Thanks @DanielaE (Daniela Engert).

  • Fixed locale-dependent formatting (#905).

  • Fixed various compiler warnings and errors (#882, #886, #933, #941, #931, #943, #954, #956, #962, #965, #977, #983, #989). Thanks @Luthaf (Guillaume Fraux), @stevenhoving (Steven Hoving), @christinaa (Kristina Brooks), @lgritz (Larry Gritz), @DanielaE (Daniela Engert), @0x8000-0000 (Sign Bit), @liuping1997.

5.2.1

21 Sep 20:48
Compare
Choose a tag to compare