[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-77661":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":9,"totalLinesOfCode":9,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":9,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":37,"readmeContent":38,"aiSummary":39,"trendingCount":16,"starSnapshotCount":16,"syncStatus":40,"lastSyncTime":41,"discoverSource":42},77661,"fmt","fmtlib\u002Ffmt","fmtlib","A modern formatting library",null,"https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Ffmt","C++",23575,2904,317,9,0,27,42,78,81,45,false,"main",[25,26,27,28,29,30,31,32,33,34,35,36],"formatting","printf","output","chrono","performance","multiplatform","cross-platform","cpp","ranges","floating-point","unicode","c-plus-plus","2026-06-12 02:03:44","\u003Cimg src=\"https:\u002F\u002Fuser-images.githubusercontent.com\u002F576385\u002F156254208-f5b743a9-88cf-439d-b0c0-923d53e8d551.png\" alt=\"{fmt}\" width=\"25%\"\u002F>\n\n[![image](https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Ffmt\u002Factions\u002Fworkflows\u002Flinux.yml\u002Fbadge.svg?branch=master)](\nhttps:\u002F\u002Fgithub.com\u002Ffmtlib\u002Ffmt\u002Factions?query=workflow%3Alinux)\n[![image](https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Ffmt\u002Factions\u002Fworkflows\u002Fmacos.yml\u002Fbadge.svg?branch=master)](\nhttps:\u002F\u002Fgithub.com\u002Ffmtlib\u002Ffmt\u002Factions?query=workflow%3Amacos)\n[![image](https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Ffmt\u002Factions\u002Fworkflows\u002Fwindows.yml\u002Fbadge.svg?branch=master)](\nhttps:\u002F\u002Fgithub.com\u002Ffmtlib\u002Ffmt\u002Factions?query=workflow%3Awindows)\n[![fmt is continuously fuzzed at oss-fuzz](https:\u002F\u002Foss-fuzz-build-logs.storage.googleapis.com\u002Fbadges\u002Ffmt.svg)](\nhttps:\u002F\u002Fissues.oss-fuzz.com\u002Fissues?q=title:fmt%20cc:victor.zverovich@gmail.com)\n[![OpenSSF Best Practices](https:\u002F\u002Fwww.bestpractices.dev\u002Fprojects\u002F8880\u002Fbadge)](\nhttps:\u002F\u002Fwww.bestpractices.dev\u002Fprojects\u002F8880)\n[![image](https:\u002F\u002Fapi.securityscorecards.dev\u002Fprojects\u002Fgithub.com\u002Ffmtlib\u002Ffmt\u002Fbadge)](\nhttps:\u002F\u002Fsecurityscorecards.dev\u002Fviewer\u002F?uri=github.com\u002Ffmtlib\u002Ffmt)\n[![Ask questions at StackOverflow with the tag fmt](\nhttps:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fstackoverflow-fmt-blue.svg)](https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002Ffmt)\n\n**{fmt}** is an open-source formatting library providing a fast and safe\nalternative to C stdio and C++ iostreams.\n\nIf you like this project, please consider donating to one of the funds\nthat help victims of the war in Ukraine: \u003Chttps:\u002F\u002Fu24.gov.ua\u002F>.\n\n[Documentation](https:\u002F\u002Ffmt.dev)\n\n[Cheat Sheets](https:\u002F\u002Fhackingcpp.com\u002Fcpp\u002Flibs\u002Ffmt.html)\n\nQ&A: ask questions on [StackOverflow with the tag\nfmt](https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002Ftagged\u002Ffmt).\n\nTry {fmt} in [Compiler Explorer](https:\u002F\u002Fgodbolt.org\u002Fz\u002F8Mx1EW73v).\n\n# Features\n\n- Simple [format API](https:\u002F\u002Ffmt.dev\u002Flatest\u002Fapi\u002F) with positional\n  arguments for localization\n- Implementation of [C++20\n  std::format](https:\u002F\u002Fen.cppreference.com\u002Fw\u002Fcpp\u002Futility\u002Fformat) and\n  [C++23 std::print](https:\u002F\u002Fen.cppreference.com\u002Fw\u002Fcpp\u002Fio\u002Fprint)\n- [Format string syntax](https:\u002F\u002Ffmt.dev\u002Flatest\u002Fsyntax\u002F) similar\n  to Python\\'s\n  [format](https:\u002F\u002Fdocs.python.org\u002F3\u002Flibrary\u002Fstdtypes.html#str.format)\n- Fast IEEE 754 floating-point formatter with correct rounding,\n  shortness and round-trip guarantees using the\n  [Dragonbox](https:\u002F\u002Fgithub.com\u002Fjk-jeon\u002Fdragonbox) algorithm\n- Portable Unicode support\n- Safe [printf\n  implementation](https:\u002F\u002Ffmt.dev\u002Flatest\u002Fapi\u002F#printf-api)\n  including the POSIX extension for positional arguments\n- Extensibility: [support for user-defined\n  types](https:\u002F\u002Ffmt.dev\u002Flatest\u002Fapi\u002F#formatting-user-defined-types)\n- High performance: faster than common standard library\n  implementations of `(s)printf`, iostreams, `to_string` and\n  `to_chars`, see [Speed tests](#speed-tests) and [Converting a\n  hundred million integers to strings per\n  second](http:\u002F\u002Fwww.zverovich.net\u002F2020\u002F06\u002F13\u002Ffast-int-to-string-revisited.html)\n- Small code size both in terms of source code with the minimum\n  configuration consisting of just three files, `base.h`, `format.h`\n  and `format-inl.h`, and compiled code; see [Compile time and code\n  bloat](#compile-time-and-code-bloat)\n- Reliability: the library has an extensive set of\n  [tests](https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Ffmt\u002Ftree\u002Fmaster\u002Ftest) and is\n  [continuously fuzzed](https:\u002F\u002Fbugs.chromium.org\u002Fp\u002Foss-fuzz\u002Fissues\u002Flist?colspec=ID%20Type%20Component%20Status%20Proj%20Reported%20Owner%20Summary&q=proj%3Dfmt&can=1)\n- Safety: the library is fully type-safe, errors in format strings can\n  be reported at compile time, automatic memory management prevents\n  buffer overflow errors\n- Ease of use: small self-contained code base, no external\n  dependencies, permissive MIT\n  [license](https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Ffmt\u002Fblob\u002Fmaster\u002FLICENSE)\n- [Portability](https:\u002F\u002Ffmt.dev\u002Flatest\u002F#portability) with\n  consistent output across platforms and support for older compilers\n- Clean warning-free codebase even on high warning levels such as\n  `-Wall -Wextra -pedantic`\n- Locale independence by default\n- Optional header-only configuration enabled with the\n  `FMT_HEADER_ONLY` macro\n\nSee the [documentation](https:\u002F\u002Ffmt.dev) for more details.\n\n# Examples\n\n**Print to stdout** ([run](https:\u002F\u002Fgodbolt.org\u002Fz\u002FTevcjh))\n\n``` c++\n#include \u003Cfmt\u002Fbase.h>\n\nint main() {\n  fmt::print(\"Hello, world!\\n\");\n}\n```\n\n**Format a string** ([run](https:\u002F\u002Fgodbolt.org\u002Fz\u002FoK8h33))\n\n``` c++\nstd::string s = fmt::format(\"The answer is {}.\", 42);\n\u002F\u002F s == \"The answer is 42.\"\n```\n\n**Format a string using positional arguments**\n([run](https:\u002F\u002Fgodbolt.org\u002Fz\u002FYn7Txe))\n\n``` c++\nstd::string s = fmt::format(\"I'd rather be {1} than {0}.\", \"right\", \"happy\");\n\u002F\u002F s == \"I'd rather be happy than right.\"\n```\n\n**Print dates and times** ([run](https:\u002F\u002Fgodbolt.org\u002Fz\u002Fc31ExdY3W))\n\n``` c++\n#include \u003Cfmt\u002Fchrono.h>\n\nint main() {\n  auto now = std::chrono::system_clock::now();\n  fmt::print(\"Date and time: {}\\n\", now);\n  fmt::print(\"Time: {:%H:%M}\\n\", now);\n}\n```\n\nOutput:\n\n    Date and time: 2023-12-26 19:10:31.557195597\n    Time: 19:10\n\n**Print a container** ([run](https:\u002F\u002Fgodbolt.org\u002Fz\u002FMxM1YqjE7))\n\n``` c++\n#include \u003Cvector>\n#include \u003Cfmt\u002Franges.h>\n\nint main() {\n  std::vector\u003Cint> v = {1, 2, 3};\n  fmt::print(\"{}\\n\", v);\n}\n```\n\nOutput:\n\n    [1, 2, 3]\n\n**Check a format string at compile time**\n\n``` c++\nstd::string s = fmt::format(\"{:d}\", \"I am not a number\");\n```\n\nThis gives a compile-time error in C++20 because `d` is an invalid\nformat specifier for a string.\n\n**Write a file from a single thread**\n\n``` c++\n#include \u003Cfmt\u002Fos.h>\n\nint main() {\n  auto out = fmt::output_file(\"guide.txt\");\n  out.print(\"Don't {}\", \"Panic\");\n}\n```\n\nThis can be [up to 9 times faster than `fprintf`](\nhttp:\u002F\u002Fwww.zverovich.net\u002F2020\u002F08\u002F04\u002Foptimal-file-buffer-size.html).\n\n**Print with colors and text styles**\n\n``` c++\n#include \u003Cfmt\u002Fcolor.h>\n\nint main() {\n  fmt::print(fg(fmt::color::crimson) | fmt::emphasis::bold,\n             \"Hello, {}!\\n\", \"world\");\n  fmt::print(fg(fmt::color::floral_white) | bg(fmt::color::slate_gray) |\n             fmt::emphasis::underline, \"Olá, {}!\\n\", \"Mundo\");\n  fmt::print(fg(fmt::color::steel_blue) | fmt::emphasis::italic,\n             \"你好{}！\\n\", \"世界\");\n}\n```\n\nOutput on a modern terminal with Unicode support:\n\n![image](https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Ffmt\u002Fassets\u002F576385\u002F2a93c904-d6fa-4aa6-b453-2618e1c327d7)\n\n# Benchmarks\n\n## Speed tests\n\n| Library           | Method        | Run Time, s |\n|-------------------|---------------|-------------|\n| libc              | printf        |   0.66      |\n| libc++            | std::ostream  |   1.63      |\n| {fmt} 12.1        | fmt::print    |   0.44      |\n| Boost Format 1.88 | boost::format |   3.89      |\n| Folly Format      | folly::format |   1.28      |\n\n{fmt} is the fastest of the benchmarked methods, \\~50% faster than\n`printf`.\n\nThe above results were generated by building `tinyformat_test.cpp` on\nmacOS 15.6.1 with `clang++ -O3 -DNDEBUG -DSPEED_TEST -DHAVE_FORMAT`, and\ntaking the best of three runs. In the test, the format string\n`\"%0.10f:%04d:%+g:%s:%p:%c:%%\\n\"` or equivalent is filled 2,000,000\ntimes with output sent to `\u002Fdev\u002Fnull`; for further details refer to the\n[source](https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Fformat-benchmark\u002Fblob\u002Fmaster\u002Fsrc\u002Ftinyformat-test.cc).\n\n{fmt} is up to 20-30x faster than `std::ostringstream` and `sprintf` on\nIEEE754 `float` and `double` formatting\n([dtoa-benchmark](https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Fdtoa-benchmark)) and faster\nthan [double-conversion](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fdouble-conversion)\nand [ryu](https:\u002F\u002Fgithub.com\u002Fulfjack\u002Fryu):\n\n[![image](https:\u002F\u002Fuser-images.githubusercontent.com\u002F576385\u002F95684665-11719600-0ba8-11eb-8e5b-972ff4e49428.png)](https:\u002F\u002Ffmt.dev\u002Funknown_mac64_clang12.0.html)\n\n## Compile time and code bloat\n\nThe script [bloat-test.py][test] from [format-benchmark][bench] tests compile\ntime and code bloat for nontrivial projects. It generates 100 translation units\nand uses `printf()` or its alternative five times in each to simulate a\nmedium-sized project. The resulting executable size and compile time (Apple\nclang version 15.0.0 (clang-1500.1.0.2.5), macOS Sonoma, best of three) is shown\nin the following tables.\n\n[test]: https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Fformat-benchmark\u002Fblob\u002Fmaster\u002Fbloat-test.py\n[bench]: https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Fformat-benchmark\n\n**Optimized build (-O3)**\n\n| Method          | Compile Time, s | Executable size, KiB | Stripped size, KiB |\n|-----------------|-----------------|----------------------|--------------------|\n| printf          |             1.6 |                   54 |                 50 |\n| IOStreams       |            28.4 |                   98 |                 84 |\n| {fmt} `1122268` |             5.0 |                   54 |                 50 |\n| tinyformat      |            32.6 |                  164 |                136 |\n| Boost Format    |            55.0 |                  530 |                317 |\n\n{fmt} is fast to compile and is comparable to `printf` in terms of per-call\nbinary size (within a rounding error on this system).\n\n**Non-optimized build**\n\n| Method          | Compile Time, s | Executable size, KiB | Stripped size, KiB |\n|-----------------|-----------------|----------------------|--------------------|\n| printf          |             1.4 |                   54 |                 50 |\n| IOStreams       |            27.0 |                   88 |                 68 |\n| {fmt} `1122268` |             4.7 |                   87 |                 84 |\n| tinyformat      |            28.1 |                  185 |                145 |\n| Boost Format    |            38.9 |                  678 |                381 |\n\n`libc`, `lib(std)c++`, and `libfmt` are all linked as shared libraries\nto compare formatting function overhead only. Boost Format is a\nheader-only library so it doesn\\'t provide any linkage options.\n\n## Running the tests\n\nPlease refer to [Building the\nlibrary](https:\u002F\u002Ffmt.dev\u002Flatest\u002Fget-started\u002F#building-from-source) for\ninstructions on how to build the library and run the unit tests.\n\nBenchmarks reside in a separate repository,\n[format-benchmarks](https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Fformat-benchmark), so to\nrun the benchmarks you first need to clone this repository and generate\nMakefiles with CMake:\n\n    $ git clone --recursive https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Fformat-benchmark.git\n    $ cd format-benchmark\n    $ cmake .\n\nThen you can run the speed test:\n\n    $ make speed-test\n\nor the bloat test:\n\n    $ make bloat-test\n\n# Migrating code\n\n[clang-tidy](https:\u002F\u002Fclang.llvm.org\u002Fextra\u002Fclang-tidy\u002F) v18 provides the\n[modernize-use-std-print](https:\u002F\u002Fclang.llvm.org\u002Fextra\u002Fclang-tidy\u002Fchecks\u002Fmodernize\u002Fuse-std-print.html)\ncheck that is capable of converting occurrences of `printf` and\n`fprintf` to `fmt::print` if configured to do so. (By default it\nconverts to `std::print`.)\n\n# Notable projects using this library\n\n- [0 A.D.](https:\u002F\u002Fplay0ad.com\u002F): a free, open-source, cross-platform\n  real-time strategy game\n- [AMPL\u002FMP](https:\u002F\u002Fgithub.com\u002Fampl\u002Fmp): an open-source library for\n  mathematical programming\n- [Apple's FoundationDB](https:\u002F\u002Fgithub.com\u002Fapple\u002Ffoundationdb): an open-source,\n  distributed, transactional key-value store\n- [Aseprite](https:\u002F\u002Fgithub.com\u002Faseprite\u002Faseprite): animated sprite\n  editor & pixel art tool\n- [AvioBook](https:\u002F\u002Fwww.aviobook.aero\u002Fen): a comprehensive aircraft\n  operations suite\n- [Blizzard Battle.net](https:\u002F\u002Fbattle.net\u002F): an online gaming\n  platform\n- [Celestia](https:\u002F\u002Fcelestia.space\u002F): real-time 3D visualization of\n  space\n- [Ceph](https:\u002F\u002Fceph.com\u002F): a scalable distributed storage system\n- [ccache](https:\u002F\u002Fccache.dev\u002F): a compiler cache\n- [ClickHouse](https:\u002F\u002Fgithub.com\u002FClickHouse\u002FClickHouse): an\n  analytical database management system\n- [ContextVision](https:\u002F\u002Fwww.contextvision.com\u002F): medical imaging software\n- [Contour](https:\u002F\u002Fgithub.com\u002Fcontour-terminal\u002Fcontour\u002F): a modern\n  terminal emulator\n- [CUAUV](https:\u002F\u002Fcuauv.org\u002F): Cornell University\\'s autonomous\n  underwater vehicle\n- [Drake](https:\u002F\u002Fdrake.mit.edu\u002F): a planning, control, and analysis\n  toolbox for nonlinear dynamical systems (MIT)\n- [Envoy](https:\u002F\u002Fgithub.com\u002Fenvoyproxy\u002Fenvoy): C++ L7 proxy and\n  communication bus (Lyft)\n- [FiveM](https:\u002F\u002Ffivem.net\u002F): a modification framework for GTA V\n- [fmtlog](https:\u002F\u002Fgithub.com\u002FMengRao\u002Ffmtlog): a performant\n  fmtlib-style logging library with latency in nanoseconds\n- [Folly](https:\u002F\u002Fgithub.com\u002Ffacebook\u002Ffolly): Facebook open-source\n  library\n- [GemRB](https:\u002F\u002Fgemrb.org\u002F): a portable open-source implementation\n  of Bioware's Infinity Engine\n- [Grand Mountain\n  Adventure](https:\u002F\u002Fstore.steampowered.com\u002Fapp\u002F1247360\u002FGrand_Mountain_Adventure\u002F):\n  a beautiful open-world ski & snowboarding game\n- [HarpyWar\u002Fpvpgn](https:\u002F\u002Fgithub.com\u002Fpvpgn\u002Fpvpgn-server): Player vs\n  Player Gaming Network with tweaks\n- [KBEngine](https:\u002F\u002Fgithub.com\u002Fkbengine\u002Fkbengine): an open-source\n  MMOG server engine\n- [Keypirinha](https:\u002F\u002Fkeypirinha.com\u002F): a semantic launcher for\n  Windows\n- [Kodi](https:\u002F\u002Fkodi.tv\u002F) (formerly xbmc): home theater software\n- [Knuth](https:\u002F\u002Fkth.cash\u002F): high-performance Bitcoin full-node\n- [libunicode](https:\u002F\u002Fgithub.com\u002Fcontour-terminal\u002Flibunicode\u002F): a\n  modern C++17 Unicode library\n- [MariaDB](https:\u002F\u002Fmariadb.org\u002F): relational database management\n  system\n- [Microsoft Verona](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fverona): research\n  programming language for concurrent ownership\n- [MongoDB](https:\u002F\u002Fmongodb.com\u002F): distributed document database\n- [MongoDB Smasher](https:\u002F\u002Fgithub.com\u002Fduckie\u002Fmongo_smasher): a small\n  tool to generate randomized datasets\n- [OpenSpace](https:\u002F\u002Fopenspaceproject.com\u002F): an open-source\n  astrovisualization framework\n- [PenUltima Online (POL)](https:\u002F\u002Fwww.polserver.com\u002F): an MMO server,\n  compatible with most Ultima Online clients\n- [PyTorch](https:\u002F\u002Fgithub.com\u002Fpytorch\u002Fpytorch): an open-source\n  machine learning library\n- [quasardb](https:\u002F\u002Fwww.quasardb.net\u002F): a distributed,\n  high-performance, associative database\n- [Quill](https:\u002F\u002Fgithub.com\u002Fodygrd\u002Fquill): asynchronous low-latency\n  logging library\n- [QKW](https:\u002F\u002Fgithub.com\u002Fravijanjam\u002Fqkw): generalizing aliasing to\n  simplify navigation, and execute complex multi-line terminal\n  command sequences\n- [redis-cerberus](https:\u002F\u002Fgithub.com\u002FHunanTV\u002Fredis-cerberus): a Redis\n  cluster proxy\n- [redpanda](https:\u002F\u002Fvectorized.io\u002Fredpanda): a 10x faster Kafka®\n  replacement for mission-critical systems written in C++\n- [rpclib](http:\u002F\u002Frpclib.net\u002F): a modern C++ msgpack-RPC server and\n  client library\n- [Salesforce Analytics\n  Cloud](https:\u002F\u002Fwww.salesforce.com\u002Fanalytics-cloud\u002Foverview\u002F):\n  business intelligence software\n- [Scylla](https:\u002F\u002Fwww.scylladb.com\u002F): a Cassandra-compatible NoSQL\n  data store that can handle 1 million transactions per second on a\n  single server\n- [Seastar](http:\u002F\u002Fwww.seastar-project.org\u002F): an advanced, open-source\n  C++ framework for high-performance server applications on modern\n  hardware\n- [spdlog](https:\u002F\u002Fgithub.com\u002Fgabime\u002Fspdlog): super fast C++ logging\n  library\n- [Stellar](https:\u002F\u002Fwww.stellar.org\u002F): financial platform\n- [Touch Surgery](https:\u002F\u002Fwww.touchsurgery.com\u002F): surgery simulator\n- [TrinityCore](https:\u002F\u002Fgithub.com\u002FTrinityCore\u002FTrinityCore):\n  open-source MMORPG framework\n- [🐙 userver framework](https:\u002F\u002Fuserver.tech\u002F): open-source\n  asynchronous framework with a rich set of abstractions and database\n  drivers\n- [Windows Terminal](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fterminal): the new\n  Windows terminal\n\n[More\\...](https:\u002F\u002Fgithub.com\u002Fsearch?q=fmtlib&type=Code)\n\nIf you are aware of other projects using this library, please let me\nknow by [email](mailto:victor.zverovich@gmail.com) or by submitting an\n[issue](https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Ffmt\u002Fissues).\n\n# Motivation\n\nSo why yet another formatting library?\n\nThere are plenty of methods for doing this task, from standard ones like\nthe printf family of function and iostreams to Boost Format and\nFastFormat libraries. The reason for creating a new library is that\nevery existing solution that I found either had serious issues or\ndidn\\'t provide all the features I needed.\n\n## printf\n\nThe good thing about `printf` is that it is pretty fast and readily\navailable being a part of the C standard library. The main drawback is\nthat it doesn\\'t support user-defined types. `printf` also has safety\nissues although they are somewhat mitigated with [\\_\\_attribute\\_\\_\n((format (printf,\n\\...))](https:\u002F\u002Fgcc.gnu.org\u002Fonlinedocs\u002Fgcc\u002FCommon-Attributes.html) in\nGCC. There is a POSIX extension that adds positional arguments required\nfor\n[i18n](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FInternationalization_and_localization)\nto `printf` but it is not a part of C99 and may not be available on some\nplatforms.\n\n## iostreams\n\nThe main issue with iostreams is best illustrated with an example:\n\n``` c++\nstd::cout \u003C\u003C std::setprecision(2) \u003C\u003C std::fixed \u003C\u003C 1.23456 \u003C\u003C \"\\n\";\n```\n\nwhich is a lot of typing compared to printf:\n\n``` c++\nprintf(\"%.2f\\n\", 1.23456);\n```\n\nMatthew Wilson, the author of FastFormat, called this \\\"chevron hell\\\".\niostreams don\\'t support positional arguments by design.\n\nThe good part is that iostreams support user-defined types and are safe\nalthough error handling is awkward.\n\n## Boost Format\n\nThis is a very powerful library that supports both `printf`-like format\nstrings and positional arguments. Its main drawback is performance.\nAccording to various benchmarks, it is much slower than other methods\nconsidered here. Boost Format also has excessive build times and severe\ncode bloat issues (see [Benchmarks](#benchmarks)).\n\n## FastFormat\n\nThis is an interesting library that is fast, safe and has positional\narguments. However, it has significant limitations, citing its author:\n\n> Three features that have no hope of being accommodated within the\n> current design are:\n>\n> - Leading zeros (or any other non-space padding)\n> - Octal\u002Fhexadecimal encoding\n> - Runtime width\u002Falignment specification\n\nIt is also quite big and has a heavy dependency, on STLSoft, which might be\ntoo restrictive for use in some projects.\n\n## Boost Spirit.Karma\n\nThis is not a formatting library but I decided to include it here for\ncompleteness. As iostreams, it suffers from the problem of mixing\nverbatim text with arguments. The library is pretty fast, but slower on\ninteger formatting than `fmt::format_to` with format string compilation\non Karma\\'s own benchmark, see [Converting a hundred million integers to\nstrings per\nsecond](http:\u002F\u002Fwww.zverovich.net\u002F2020\u002F06\u002F13\u002Ffast-int-to-string-revisited.html).\n\n# License\n\n{fmt} is distributed under the MIT\n[license](https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Ffmt\u002Fblob\u002Fmaster\u002FLICENSE).\n\n# Documentation License\n\nThe [Format String Syntax](https:\u002F\u002Ffmt.dev\u002Flatest\u002Fsyntax\u002F) section\nin the documentation is based on the one from Python [string module\ndocumentation](https:\u002F\u002Fdocs.python.org\u002F3\u002Flibrary\u002Fstring.html#module-string).\nFor this reason, the documentation is distributed under the Python\nSoftware Foundation license available in\n[doc\u002Fpython-license.txt](https:\u002F\u002Fraw.github.com\u002Ffmtlib\u002Ffmt\u002Fmaster\u002Fdoc\u002Fpython-license.txt).\nIt only applies if you distribute the documentation of {fmt}.\n\n# Maintainers\n\nThe {fmt} library is maintained by Victor Zverovich\n([vitaut](https:\u002F\u002Fgithub.com\u002Fvitaut)) with contributions from many other\npeople. See\n[Contributors](https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Ffmt\u002Fgraphs\u002Fcontributors) and\n[Releases](https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Ffmt\u002Freleases) for some of the\nnames. Let us know if your contribution is not listed or mentioned\nincorrectly and we\\'ll make it right.\n\n# Security Policy\n\nTo report a security issue, please disclose it at [security\nadvisory](https:\u002F\u002Fgithub.com\u002Ffmtlib\u002Ffmt\u002Fsecurity\u002Fadvisories\u002Fnew).\n\nThis project is maintained by a team of volunteers on a\nreasonable-effort basis. As such, please give us at least *90* days to\nwork on a fix before public exposure.\n","fmtlib\u002Ffmt 是一个现代的 C++ 格式化库，旨在提供比 C stdio 和 C++ iostreams 更快速和安全的替代方案。其核心功能包括简洁的格式 API、对 C++20 的 std::format 和 C++23 的 std::print 的实现、类似 Python 的格式字符串语法、高效的 IEEE 754 浮点数格式化器以及对用户自定义类型的扩展支持。此外，它还提供了高性能的 printf 实现，并且在多平台环境下具有良好的可移植性。该库适用于需要高效、安全且易于使用的文本格式化的 C++ 应用场景，如日志记录、数据输出及用户界面展示等。",2,"2026-06-11 03:55:44","trending"]